Tuesday 28 June 2022

MathWithNaziaa : Derivative and Undefined Derivatives

 Definition

Let f ( x )  be a real valued function defined on an open interval ( a, b ) and let c  ( a, b ). Then, f ( x ) is said to be differentiable or derivative at x = c if and only if, 




The definition of the derivative is derived from the formula for the slope of a line. Recall that the slope of a line is the rate of change of the line, which is computed as the ratio of the change in y to the change in x. Geometrically, the derivative is the slope of the line tangent to the curve at a point of interest. It is sometimes referred to as the instantaneous rate of change. Typically, we calculate the slope of a line using two points on the line. This is not possible for a curve, since the slope of a curve changes from point to point. Consider the figure below.

The figure shows a curve (blue) with two points: (x, f(x)) and (x + h, f(x + h)). The grey secant line represents the slope between these two points and is computed as:


Notice that this is beginning to look like the definition of the derivative. However, this formula gives us the slope between the two points, which is an average of the slope of the curve. The derivative at x is represented by the red line in the figure. To calculate the slope of this line, we need to modify the slope formula so that it can be used for a single point. We do this by computing the limit of the slope formula as the change in x (Δx), denoted h, approaches 0. By doing this, we find the slope between two points separated by a difference so small that it provides an approximation for the slope at a single point, leading us to the definition of the derivative stated above.


Example 1

Find the derivative of  f ( x )  = k at x = 0 and x = 5

Solution

We are required to find the derivative of  f ( x )  = k at x = 0 and x = 5

Similalry,

Example 2

Use the limit definition of a derivative to differentiate (find the derivative of) the following functions.


Example 3

f(x) = sin(x):



Table of derivative rules

Notice from the examples above that it can be fairly cumbersome to compute derivatives using the limit definition. Fortunately, the rules for computing the derivatives for different types of functions are well-defined, so simply knowing (or being able to reference) these rules enables us to differentiate most functions.

 


Undefined derivatives : 

It is not always possible to find the derivative of a function. In some cases, the derivative of a function may fail to exist at certain points on its domain, or even over its entire domain. Generally, the derivative of a function does not exist if the slope of its graph is not well-defined. Below are some of these cases. 

Discontinuous functions :

For a function to have a derivative at a given point, it must be continuous at that point. A function that is discontinuous at a point has no slope at that point, and therefore no derivative. Briefly, a function f(x) is continuous at a point a if the following conditions are met:



The figure below shows one type of discontinuity, referred to as a jump discontinuity, at the point x = 3.

Since the function is discontinuous at this point, it does not have a derivative at x = 3.

Cusps/corners

Functions with cusps or corners do not have defined slopes at the cusps or corners, so they do not have derivatives at those points. This is because the slope to the left and right of these points are not equal.


Both functions have either a cusp or a corner at x = 2, where the slope of the function differs depending on whether we approach the point from the left or the right side. Thus, the derivative is undefined at x = 2.

Vertical tangents or infinite slope
A function that has a vertical tangent line has an infinite slope, and is therefore undefined.


The function has a vertical tangent at x = 0. On either side of the vertical tangent, the slope of the function approaches infinity.

MathWithNaziaa : Pythagoras theorem with Examples

 Pythagoras theorem 

      

             Pythagoras Theorem is also called the Pythagorean theorem. This is named after a Greek mathematician called Pythagoras. This theorem explains the relationship of the sides of the right angle triangle.  the side of the right angle triangle also called as Pythagorean triples.



Pythagoras Theorem statement:

                     

                                Pythagoras Theorem states that “  in a right angle triangle the square of the hypotenuse side is equal to the sum of the squares of the other two sides ”. 

                               

                               The three sides of the triangle are hypotenuse, base and perpendicular. Hypotenuse is the longest side of the triangle or it can also be said as the side opposite to 90.


Pythagoras Theorem proof :

 

Given : A right angle triangle ABC,  right angled at B.


To prove:  (AC)² = (AB)² + (BC)²


Construction:  Draw a perpendicular line BD to meet AC at  D.







 Example


  1.  In a right angle triangle ABC AB = 6 BC = 8 find AC









Converse of Pythagoras theorem



Converse of Pythagoras Theorem statement:

                   

                                    The Converse of Pythagoras Theorem states that “  if the square of a side is equal to the sum of the squares of the other two sides then the triangle is a right angled triangle”





 Converse of Pythagoras Theorem proof:



 Given:   (AC)² = (AB)² + (BC)²


To prove :  ABC is a right angled triangle.


 Construction:  construct a triangle EFG such that AB = EF = A ,  BC = FG = b







                      

Examples of Pythagoras theorem:


  1. Find the length of AE?




ABCE is a rectangle,  AB=EC = 6m

                                   BC = AC = 12m


Applying Pythagoras theorem, we get,

                           (AD)²= (DE)²+ (AE)²

                          (AD)² = 122 + 52

                           (AD)²   = 144 + 25

                            (AD)²   = 169

                           AD = 13 m





  1. Find the perimeter of the rectangle, whose length is 24cm and diagonal is 26cm?





Let us take BCD

   AC=24  , DB = Hypotenus = 26 


Using Pythagoras theorem, 

     

              DB2 = DC2 +CB2

              (26)² = (24)² + (CB)²

              676 = 576 + (CB)²

             676 - 576  = (CB)²

                100        = (CB)²

                  CB = 10


L=24  ; B= 10




Perimeter of a rectangle = 2( L+B) 

                                         = 2( 24 + 10 )

                                        = 2 ( 34)

                                        = 68



  1. A ladder 8.5m long rests against a vertical wall its foot 4m away from the wall.  How high up the wall the ladder reach? 



Using Pythagoras theorem, 

    (AC)² = (BC)² + (AB)²

    (8.5)²= (BC)² + 42

    72.25 - 16 = (BC)²

      56.25 = (BC)²

          BC = 7.5m


Therefore the ladder reaches the wall 7.5m


Examples of Pythagoras Theorem :

The top of a ladder of length 15 m reaches a window 9 m above the ground. What is the distance between the base of the wall and that of the ladder ?

 

Let LN be a ladder of length 15 m that is resting against a wall. Let M be the base of the wall and L be the position of the window.

The window is 9 m above the ground. Now, MN is the distance between the base of the wall and that of the ladder.

In the right angled triangle LMN, ∠M = 90. Hence, side LN is the hypotenuse.

According to Pythagoras' theorem,

(LN)² = (MN)² + (LM)²

(15)² = (MN)² + (9)²

(225) = (MN)² + 81

(MN)² = 225 − 81

(MN)² = 144

(MN)² = (12)²

MN = 12

∴ Length of seg MN = 16 m.

Hence, the distance between the base2 of the wall and that of the ladder is 12 m.

 

 

 

 

In the right-angled ∆LMN, ∠ M = 90°. If l(LM) = 12 cm and l(LN) = 20 cm, find the length of seg MN.

 

 

In the right angled triangle LMN, ∠M = 90. Hence, side LN is the hypotenuse.

According to Pythagoras' theorem,

(LN)² = (MN)² + (LM)²

(20)² = (MN)² + (12)²

400 = (MN)² + 144

(MN)² = 400 − 144

(MN)² = 256

(MN)² = (16)²

(MN) = 16

∴ Length of seg MN = 16 cm.

MathWithNaziaa : Importance of Mathematics in Computer Science

 Why is Mathematics important in Computer Science?

Imagine the Burj Khalifa (Tallest Building in the world). Now, what is the most important part of this building? No, not it’s not the height (well, that too!) but mainly its foundation. If the Burj Khalifa did not have a strong foundation, it would have been fairly wobbly and much more likely to fall than stand!!

Now, in case you are wondering about this off-topic story, Mathematics is the foundation on which Computer Science is built (Burj Khalifa…get it?!). In fact, it can even be said that Computer Science is the subset of Mathematical Sciences in general. How so? Well, some points that demonstrate this are given below:

1. Discrete Mathematics is the Foundation of Computer Science

Ever heard of Logic Notation, Set Theory, Combinatorics, Graph Theory, Probability, Number Theory, Algebra, etc.? Don’t be overwhelmed, these are all a part of Discrete Mathematics and also a basic foundation for Programming and Computer Science (And that means you need to study these for Computer Science!!!).

A prime example of this is Algebra. While Boolean Algebra is used in Logic Gates, Relational Algebra is used in Databases. In case you need another example, Number Theory has multiple applications in Cryptography and Cryptanalysis. (See the importance yet?!)

 

2. Mathematics Provides the Analytical Skills Required in Computer Science

Analytical skills are necessary for problem-solving and data analyzation. And guess where you first use these skills? Mathematics!!! Yeah, Mathematics always forces you to analyze your equations and understand the derivation flow in case a mistake is made. This mistake needs to be fixed in order to obtain the final solution.

This provides lots of analytical skills that can be used later in finding and fixing bugs!!! Even though there are modern tools that can do this job automatically, the experience and knowledge gained about the program flow and debugging is invaluable.

3. Mathematics Teaches the Usage of Algorithms

Algorithms are a fundamental part of Computer Science and all of you must have heard of them one way or another (If not…you need to study again!!!). They are basically a set of instructions that demonstrate the implementation of a program or an application.

Now, where did you first use an algorithm? It was not the Computer Science class but actually the Mathematics class! Don’t believe me?!! Well, “2 + 3 = 5” is a basic algorithm you learned in Mathematics class that demonstrates the sum of 2 and 3. Mathematics is actually very important in learning the basic usage of algorithms that are utilized in an advanced form in Computer Science.

4. Mathematical Concepts are Required in many Disciplines of Computer Science

Computer Science is an umbrella term that contains many disciplines like Operating Systems, Databases, Networking, Artificial intelligence, Embedded systems, Data analytics….need I go on?!!! And while there are some disciplines that you can handle with minimal knowledge of Mathematics, most of them require at least some level of competency.

For example, fields like Artificial Intelligence and Machine Learning require a thorough knowledge of Mathematical concepts like Linear algebra, Multivariable Calculus, Probability Theory, etc. (And that makes Maths pretty important!!!)

So What’s the Conclusion?

Is Mathematics really necessary Computer Science? Well, some would say that it depends on the job. For Example: Creating a blog on food does not necessarily require any knowledge of mathematics. But creating a successful blog is another thing entirely. It requires a focus on audience preferences, topic popularity, article ratings, etc. And guess what…Mathematics is required for all of this.

So yes…Mathematics is present in the foundation of Computer Science. And if you want to succeed in any discipline of Computer Science, it is much better to inculcate a love of Mathematics as that will help you tremendously.

What Kind of Math Is Used in Computer Science?

Computer scientists use all different types of math. Those who work with advanced algorithms and matrices, like the kind involved in image recognition for medical diagnostics, need to understand higher-level concepts like differential equations.

But for aspiring and first year professionals, it’s more important to master number theory and basic equations. Here are some topics to explore.

Binary and Hexadecimal Counting

The binary number system uses only two digits, 0 and 1, to express all mathematical concepts. Computers use the binary system instead of the more common decimal system, so computer scientists need to know how it works.

Computers can read binary, but it can be inconvenient for humans to deal with. As an alternative, computer programming has turned to a system called hexadecimal, which uses all nine decimal digits and the letters A through F. It makes more sense to humans and converts electronically to binary.

Don’t let the unfamiliarity of these languages scare you away. Computer Science Program tend to cover them early on, so you can start practicing right away.

Discrete Mathematics

Discrete Mathematics is tangible math. It analyzes the relationship between things that are distinct and separate. The concepts of discrete math include:

  • Probability
  • Combinatorics
  • Logic
  • Number theory
  • Graph theory

The problem-solving processes of discrete math are the basis of modern computer engineering. They power both simple and complex disciplines such as:

  • Computer architecture 
  • Functional programming
  • Distributed systems
  • Machine learning and artificial intelligence

As a computer science professional, you might use discrete math to test out multiple algorithms and learn which is the most efficient. Meanwhile, the logical thinking you develop as a discrete math student will help you to approach programming and development tasks more methodically.

Statistics

Data has become an increasingly important aspect of scientific computing in the past few years, from machine learning to personalized app performance. This increased reliance on data has made statistics an important topic of study for all computer science students.

Statistics allow computer programs to deliver accurate generalizations and predictions based on available information. Understanding statistics can make it easier to grasp concepts like:

  • Data mining
  • Machine learning
  • Future modeling
  • Speech recognition
  • User responsiveness
  • Computer graphics analysis

The more you learn about statistics, the more adept you’ll become at managing and using complex data structures. This lets you write more advanced algorithms and push the envelope in software customization.

Linear Algebra

Computer science and software engineering rely on algorithms. An algorithm is a formula that takes you from a specific input to the correct output. If that sounds familiar, it may be reminding you of middle school or high school algebra.

Algebra includes concepts like:

  • Exponents
  • Polynomials
  • Linear equations
  • Quadratic equations

Each of these concepts has real world computer science applications. Understanding exponential relationships can help you to adapt visuals so they appeal to the eye. Solving linear equations helps with analysis of algorithms because it helps you to spot inaccuracies.

You can get by in software development without knowing much algebra, but learning it can help you to reach greater heights.

Calculus

If you plan to get a computer science degree, you’ll probably take a calculus course at some point. 

There are two different types of calculus: integral calculus and differential calculus. Together, these disciplines help you to figure out rate of change, which is an important ingredient in many algorithms and programs.

Differential equations are particularly important. A differential equation calculates how something changes and how fast that happens, so a computer can predict future outputs. This helps with:

  • Designing simulations
  • Improving problem-solving programs
  • Creating effective algorithms
  • Developing accurate graphs

The word “calculus” scares some computer science students, but it’s much less intimidating than most people think. The key is to find a course that will lead you through what you need to know to work in your field.

The Relationship between Mathematics and Computer Science

1. Mathematics is abstract in nature

Most concepts of maths are taught through abstract language. On the other hand, one of the things that are covered in computer science is the study of programming languages. Most of these languages are also abstract in nature. They are characterized by syntax, well-defined processes, symbols, single words, and even visuals.

Given the abstract nature of maths, you will have a smooth sailing when learning programming languages. Mathematics will impart a student with the art of reading, understanding and analyzing a problem before coming up with a solution. All these skills are vital when it comes to programming and computer science in general.

2. Maths teaches on how to utilize algorithms

An algorithm is a commonly used term in the field of computer science and technology in general. It provides a basis under which any program or application should be created and implemented.

Although most people encounter this term for the first time in a computer science class, the truth of the matter is they were introduced to it in a math class. Do you know that a simple equation such as 7+3=10 is an algorithm? From such simple equations, students are then introduced to complex algorithms in computer science.

3. Mathematics gives students analysis skills

Coding is not a one-way process. You have to keep coming back to inspect what you have written and verified whether it is correct. This is because you are bound to make one or several mistakes when coding.

In the field of mathematics, students are usually forced to analyze their work. The answers that you might have given are not always accurate. You need to come back and inspect the formula and the figures that you have used. You will fix the mistake or errors before reaching out to your final answer.

In other words, maths prepares students for the tasks of identifying and fixing bugs. Even if there are tools that can do this job automatically, students will still have the zeal of doing this job effortlessly.

4. Computer science has lots of maths

Apart from the above skills, you will also encounter lots of maths in computer science. Here you will be required to use mathematics knowledge to solve real-life problems through a computer. Woe unto you if you never took your math classes seriously.

For instance, there are lots of mathematical equations and formulas that are used to design a program for controlling a self-driven car. It will be very difficult if not impossible to write such programs if you are completely green in the field of mathematics.

5. Discrete maths is the background of computer science

It is not a secret that discrete mathematics forms a strong foundation for the study of programming and computer science. It will equip you with deep knowledge about algorithms, computability, and complexity which you will use in programming. Boolean algebra- a subject in discrete math is applied in creating control functions when programming. Once you master these mathematical theories, you will have an easy time putting them into practice in computer science.