← All posts
In progress

Estimates are just enough

Note ~7 min read

I hope you know what a function is. If you don’t I would care to explain. Simply put a function is a machine.

A machine that takes in input, performs some processing on it and returns an output.

Here is a function. A simple one. Guess what it does. (FYI, its read as “f of x is equal to x plus 5.” )

f(x)=x+5f(x) = x+5

It simply takes an input x and adds 5 to it before spitting out an output. consider a set of five elements

X={1,2,3,4,5}X = \{1,2,3,4,5\}

The set of our outputs would be after passing each element through the machine (function)

Y={6,7,8,9,10}Y = \{6,7,8,9,10\} This gives us a mapping from x∈Xx \in X to f(x)∈Yf(x) \in Y

XY1→62→73→84→95→10\begin{array}{ccc} \mathbf{X} & & \mathbf{Y} \\ 1 & \to & 6 \\ 2 & \to & 7 \\ 3 & \to & 8 \\ 4& \to & 9 \\ 5& \to & 10 \end{array}

So yeah you get the idea. There are lots of these machines(uhmm functions) such as: f(x)=x2f(x)=x5−x2+7f(x)= x^2 \qquad f(x) = x^5 - x^2 + 7

 Take an example of the function:  f(x)=x2f(x) = x^2 This machine takes an input, stores it in a container x, squares it and returns the squared value as output.

xx2−2→4−1→10→01→12→4\begin{array}{ccc} \boldsymbol{x}&&\boldsymbol{x^2}\\ -2 &\to&4\\ -1 & \to &1\\ 0& \to & 0\\ 1&\to&1\\ 2&\to&4 \end{array}

But take note, the input 2 and -2 both have the same output 4. This is completely acceptable. A machine can therefore be:

  1. a one to one machine where one input uniquely maps to a single output
  2. or a many to one machine where two unique inputs map to the same output.

However, if a single input results in multiple outputs after being passed through the machine, then the machine is considered broken and qualifies not to be called a function.

One to many mapping does not qualify as a valid function (machine)

The above machine types are categorized by how they map (that is whether they are one to one, or many to one). However, you can also categorize function by their form (that is their shape). In so doing, we come up with these 5 kinds of functions by form:

  1. polynomial e.g f(x)=xf(x)=4x2+2x−9f(x) = x \qquad f(x) = 4x^2 + 2x - 9
  2. exponential e.g f(x)=2xf(x)=53x+2f(x) = 2^x \qquad f(x) = 5^{3x+2}
  3. logarithmic e.g f(x)=3log2xf(x) = 3log_2{x}
  4. trigonometric e.g f(x)=4sin(x)f(x) = 4sin(x) and
  5. rational e.g f(x)=1−xx2+1f(x) = \frac{1-x}{x^2+1}

Below are the forms of each.

Function Plots

[!tikz-row]

[!tikz-row-center]

Of all the 5 types of functions by form, the simplest to work with are the polynomials (a reason why computer scientists like working with them). Why the simplest you might ask? It’s because they are easy to manipulate. They are made up of basic operators, that is the multiplication, addition, subtraction and division. Operations even a computer can carry out.

Now lets get into the “Why begin this blog talking about functions? ”.Let me ask you one question that will probably make you see the the reason behind the why . what is the sine of 90.

what is sin(90)= ??\mathbf{what\ is\ }sin(90) = \ ??

You probably know that by heart after those intense A-level math classes, i doubt you can ever forget it. No need for a calculator. 90 is a standard angle and its sine is simply 1.

sin(90)=1sin(90) = 1

Good, now what is sin(67)? Not so easy anymore,huh. Now you definetly need a calculator. Using a calculator simply shifts the problem to the calculator. How does the calculator know the answer. It is not like the calculator was hard-coded with all the possible outputs of the sine of any value you pass in as xx. That does not scale. So how does the calculator know to return

sin(67)=0.92050485345sin(67) = 0.92050485345

You would say, “Joshua, give me a second, I am pretty sure i can solve sin(67)sin(67) without using a calculator, trust me bro”. So I chill, I wait to see what tricks you pull out the bag. So at that moment, you remember the power of the equilateral triangle. So in your clever mind you say, “Imagine an equilateral triangle △ABC\triangle ABC with sides of length 2”. So I imagine it as you say.

You say to me, “from this triangle we can derive the values of sine, cosine and tan of three standard angles”. That is 30∘30^\circ , 60∘60^\circ and 90∘90^\circ . I node along as I see your brilliance start to shine. So you say, “This means:”

sin⁡(30)=AOAC=12sin⁡(60)=OCAC=32…\begin{aligned} \sin(30) = \frac{AO}{AC} = \frac{1}{2} \\[10pt] \sin(60) = \frac{OC}{AC} = \frac{\sqrt{3}}{2} \\[10pt] \dots \end{aligned}

I pause as I wait for you to show that sin⁡(90)=1\sin(90) = 1. You too pause and wonder for a while. You ask yourself, “if I consider 90 as the angle, then what is the opposite side and what is the hypotenuse”. Then you are struck by the epiphany of limits. You smirk. So you draw out the traingle △ACO\triangle ACO and place it in a unit circle.

So you say to me, “As the angle θ\theta approaches 90∘90^\circ, the length AO‾\overline{AO} becomes smaller and smaller whilst the length OC‾\overline{OC} approaches the same length as AC‾\overline{AC} ”. So you draw these diagrams just to prove the point in my face.

Interactive unit circle — drag the slider to move the angle θ from 1° to 90°.

[!tikz-row-center]

So you continue to say,“That means:”

So, in the limit as θ approaches 90∘, OC tends to become AClim⁡θ→90∘sin⁡(θ)=OCAC=ACAC=1So,sin⁡(90∘)=1And in the limit asθapp\begin{gathered} \text{So, in the limit as } \theta \text{ approaches } 90^\circ, \text{ } OC \text{ tends to become } AC \\[10pt] \lim_{\theta \to 90^\circ} \sin(\theta)=\frac{OC}{AC} =\frac{AC}{AC}=1 \\[10pt] \text{So,}\\[10pt] \sin(90^\circ) = 1 \\[20pt] \text{And in the limit as} \theta \text{app} \end{gathered}

Damn, all that to prove that sin⁡(90)=1\sin(90) = 1 . Wow, okay. I believe you. move on. So you continue on to the cosines and say:

cos(30)=OCAC=32cos⁡(60)=AOAC=12Then for cos⁡(90)as θ approaches 90∘AO approaches zeroAnd therefore cos⁡(90)=AOAC=02=0\begin{aligned} cos(30) = \frac{OC}{AC} = \frac{\sqrt{ 3 }}{2} \\[10pt] \cos(60) = \frac{AO}{AC} = \frac{1}{2}\\[10pt] Then \ for\ \cos(90)\\ as \ \theta \ approaches \ 90^\circ AO \ approaches \ zero\\ And\ therefore \ \cos(90) = \frac{A{O}}{AC} = \frac{0}{2} = 0 \end{aligned}

Okay, so we have all we need to start getting the cos(67). You say that:

cos⁡(60)=cos⁡(60+7)\cos(60) = \cos(60+7)

And according to the double angle formula, this can be written as

sin⁡(60+7)=sin⁡(60)cos⁡(7)+cos⁡(60)sin⁡(7)\sin(60+7) = \sin(60)\cos(7) + \cos(60)\sin(7) =32cos⁡(7)+12sin⁡(7)=\frac{\sqrt{ 3 }}{2}\cos(7) +\frac{1}{2}\sin(7)

Then you recall the small angle formula that says that for small angle θ\theta in radians,

sin⁡(θ)≈θ\sin(\theta) \approx \theta and cos⁡(θ)≈1\cos(\theta) \approx 1

So you change 7∘7^\circ to radians using the equation

180∘=π radians180^\circ = \pi \ radians therefore 7∘=7′π1807^\circ = \frac{7'\pi}{180}

so the equation becomes

sin⁡(60+7)=32(1)+12(7π180)\sin(60+7) = \frac{\sqrt{ 3 }}{2}(1) + \frac{1}{2}\left( \frac{7\pi}{180} \right)

Then you say, there you go, that is the sin(67). But i say, could you simplify it further to a single decimal value. You say, i will need a calculator for this, i say, that is okay. You arrive to the value

sin⁡(67)=0.927111927\sin(67) = 0.927111927

Which is close to the answer we got earlier from directly pressing sin(67) in the calculator. The difference of the two values is 0.927111927−0.920504853=0.0066070.927111927 - 0.920504853 = 0.006607 which is small enough for us to ignore. So there you go, you were able find sin(67) without using a calculator, ok maybe up to the end where you were defeated by the root of three (3\sqrt{ 3 } ). “I could find it on paper without using a calculator”, you say. I say, I believe you. Anyway, the point I am driving at here is that you were able to turn a sin into addition, division and multiplication operations which you can do on paper because they are simple. But y=xy = \sqrt{ x } is a function that crept into our final almost polynomial transformation.

The Question then becomes, How can we represent any non polynomial equation as a polynomial. This is where things become interesting.