Monday, December 9, 2019

Week of December 9, 2019

Normal Distribution

Data can be "distributed" (spread out) in different ways.
It can be spread out
more on the left
 
Or more on the right
data skewed left data skewed right
   
Or it can be all jumbled up
data random
But there are many cases where the data tends to be around a central value with no bias left or right, and it gets close to a "Normal Distribution" like this:
bell curve
A Normal Distribution
The "Bell Curve" is a Normal Distribution.
And the yellow histogram shows some data that
follows it closely, but not perfectly (which is usual).
bellIt is often called a "Bell Curve"
because it looks like a bell.
Many things closely follow a Normal Distribution:
  • heights of people
  • size of things produced by machines
  • errors in measurements
  • blood pressure
  • marks on a test
We say the data is "normally distributed":
normal distribution with mean median mode at center
The Normal Distribution has:
  • mean = median = mode
  • symmetry about the center
  • 50% of values less than the mean
    and 50% greater than the mean

Quincunx

You can see a normal distribution being created by random chance!
It is called the Quincunx and it is an amazing machine.
Have a play with it!
 quincunx

Standard Deviations

The Standard Deviation is a measure of how spread out numbers are (read that page for details on how to calculate it).
When we calculate the standard deviation we find that generally:
normal distrubution 68%, 95%, 99.7%
68% of values are within
1 standard deviation of the mean


95% of values are within
2 standard deviations of the mean


99.7% of values are within 
3 standard deviations
 of the mean

Example: 95% of students at school are between 1.1m and 1.7m tall.

Assuming this data is normally distributed can you calculate the mean and standard deviation?
The mean is halfway between 1.1m and 1.7m:
Mean = (1.1m + 1.7m) / 2 = 1.4m
95% is 2 standard deviations either side of the mean (a total of 4 standard deviations) so:
1 standard deviation= (1.7m-1.1m) / 4
 = 0.6m / 4
 0.15m
And this is the result:
normal distribution 95%
It is good to know the standard deviation, because we can say that any value is:
  • likely to be within 1 standard deviation (68 out of 100 should be)
  • very likely to be within 2 standard deviations (95 out of 100 should be)
  • almost certainly within 3 standard deviations (997 out of 1000 should be)

Standard Scores

The number of standard deviations from the mean is also called the "Standard Score", "sigma" or "z-score". Get used to those words!

Example: In that same school one of your friends is 1.85m tall


normal distribution 95%You can see on the bell curve that 1.85m is 3 standard deviations from the mean of 1.4, so:
Your friend's height has a "z-score" of 3.0
It is also possible to calculate how many standard deviations 1.85 is from the mean
How far is 1.85 from the mean?
It is 1.85 - 1.4 = 0.45m from the mean
How many standard deviations is that? The standard deviation is 0.15m, so:
0.45m / 0.15m = 3 standard deviations
So to convert a value to a Standard Score ("z-score"):
  • first subtract the mean,
  • then divide by the Standard Deviation
And doing that is called "Standardizing":
standardizing
We can take any Normal Distribution and convert it to The Standard Normal Distribution.

Example: Travel Time

A survey of daily travel time had these results (in minutes):
26, 33, 65, 28, 34, 55, 25, 44, 50, 36, 26, 37, 43, 62, 35, 38, 45, 32, 28, 34
The Mean is 38.8 minutes, and the Standard Deviation is 11.4 minutes (you can copy and paste the values into the Standard Deviation Calculator if you want).
Convert the values to z-scores ("standard scores").

To convert 26:
first subtract the mean: 26 - 38.8 = -12.8,
then divide by the Standard Deviation: -12.8/11.4 = -1.12
So 26 is -1.12 Standard Deviations from the Mean

Here are the first three conversions
Original ValueCalculationStandard Score
(z-score)
26(26-38.8) / 11.4 =-1.12
33(33-38.8) / 11.4 =-0.51
65(65-38.8) / 11.4 =+2.30
.........

And here they are graphically:
standard normal distribution scores
You can calculate the rest of the z-scores yourself!

Here is the formula for z-score that we have been using:
z score = (x-mu)/sigma 
  • z is the "z-score" (Standard Score)
  • x is the value to be standardized
  • μ is the mean
  • σ is the standard deviation

Why Standardize ... ?

It can help us make decisions about our data.

Example: Professor Willoughby is marking a test.

Here are the student's results (out of 60 points):
20, 15, 26, 32, 18, 28, 35, 14, 26, 22, 17
Most students didn't even get 30 out of 60, and most will fail.
The test must have been really hard, so the Prof decides to Standardize all the scores and only fail people 1 standard deviation below the mean.
The Mean is 23, and the Standard Deviation is 6.6, and these are the Standard Scores:
-0.45, -1.21, 0.45, 1.36, -0.76, 0.76, 1.82, -1.36, 0.45, -0.15, -0.91
Now only 2 students will fail (the ones lower than −1 standard deviation)
Much fairer!
It also makes life easier because we only need one table (the Standard Normal Distribution Table), rather than doing calculations individually for each value of mean and standard deviation.

Monday, December 2, 2019

Week of December 2, 2019

Finding inverse functions


Inverse functions, in the most general sense, are functions that "reverse" each other. For example, if f takes a to b, then the inverse, f, start superscript, minus, 1, end superscript, must take b to a.
\blueD{a}f\goldD{b}f^{-1}\blueD{a}
Or in other words, f, left parenthesis, a, right parenthesis, equals, b, \Longleftrightarrow, f, start superscript, minus, 1, end superscript, left parenthesis, b, right parenthesis, equals, a.
In this article we will learn how to find the formula of the inverse function when we have the formula of the original function.

Before we start...

In this lesson, we will find the inverse function of f, left parenthesis, x, right parenthesis, equals, 3, x, plus, 2.
Before we do that, let's first think about how we would find f, start superscript, minus, 1, end superscript, left parenthesis, 8, right parenthesis.
To find f, start superscript, minus, 1, end superscript, left parenthesis, 8, right parenthesis, we need to find the input of f that corresponds to an output of 8. This is because if f, start superscript, minus, 1, end superscript, left parenthesis, 8, right parenthesis, equals, x, then by definition of inverses, f, left parenthesis, x, right parenthesis, equals, 8.
\begin{aligned} f(x) &= 3 x+2\\\\ 8 &= 3 x+2 &&\small{\gray{\text{Let f(x)=8}}} \\\\6&=3x &&\small{\gray{\text{Subtract 2 from both sides}}}\\\\ 2&=x &&\small{\gray{\text{Divide both sides by 3}}} \end{aligned}
So f, left parenthesis, 2, right parenthesis, equals, 8 which means that f, start superscript, minus, 1, end superscript, left parenthesis, 8, right parenthesis, equals, 2

Finding inverse functions

We can generalize what we did above to find f, start superscript, minus, 1, end superscript, left parenthesis, y, right parenthesis for any y
To find f, start superscript, minus, 1, end superscript, left parenthesis, y, right parenthesis, we can find the input of f that corresponds to an output of y. This is because if f, start superscript, minus, 1, end superscript, left parenthesis, y, right parenthesis, equals, x then by definition of inverses, f, left parenthesis, x, right parenthesis, equals, y.
\begin{aligned} f(x) &= 3 x+2\\\\ y &= 3 x+2 &&\small{\gray{\text{Let f(x)=y}}} \\\\y-2&=3x &&\small{\gray{\text{Subtract 2 from both sides}}}\\\\ \dfrac{y-2}{3}&=x &&\small{\gray{\text{Divide both sides by 3}}} \end{aligned}
So f, start superscript, minus, 1, end superscript, left parenthesis, y, right parenthesis, equals, start fraction, y, minus, 2, divided by, 3, end fraction.
Since the choice of the variable is arbitrary, we can write this as f, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals, start fraction, x, minus, 2, divided by, 3, end fraction.
f, start superscript, minus, 1, end superscriptxyy
\begin{aligned} f(x)&=3x+2\\\\ \goldD y &= 3\blueD x+2 &&\small{\gray{\text{Replace f(x) with y}}}\\\\ \blueD x &= 3\goldD y+2 &&\small{\gray{\text{Switch x and y}}} \\\\x-2&=3y &&\small{\gray{\text{Subtract 2 from both sides}}}\\\\ \dfrac{x-2}{3}&=y &&\small{\gray{\text{Divide both sides by 3}}} \\\\ \end{aligned}
f, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals, start fraction, x, minus, 2, divided by, 3, end fraction

Check your understanding

1) Linear function

Find the inverse of g, left parenthesis, x, right parenthesis, equals, 2, x, minus, 5.
g, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals 
g, left parenthesis, x, right parenthesisyx
\begin{aligned} g(x)&= 2x-5 \\\\ y &= 2x-5 &&\small{\gray{\text{Replace g(x) with y}}}\\\\ y+5 &= 2x &&\small{\gray{\text{Add 5 to both sides}}}\\\\ \dfrac{y+5}{2}&=x &&\small{\gray{\text{Divide both sides by 2}}} \\\\ \dfrac{y+5}{2}&=g^{-1}(y) &&\small{\gray{\text{Replace x with }g^{-1}(y)}} \end{aligned}
yxx
g, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals, start fraction, x, plus, 5, divided by, 2, end fraction

2) Cubic function

Find the inverse of h, left parenthesis, x, right parenthesis, equals, x, cubed, plus, 2.
h, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals 
h, left parenthesis, x, right parenthesisyx
h(x)yy2y23y23=x3+2=x3+2=x3=x=h1(y)Replace h(x) with ySubtract 2 from both sidesCube root of both sidesReplace x with h^{-1}(y)
yxx
h, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals, cube root of, x, minus, 2, end cube root

3) Cube-root function

Find the inverse of f, left parenthesis, x, right parenthesis, equals, 4, dot, cube root of, x, end cube root.
f, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals 
f, left parenthesis, x, right parenthesisyx
\begin{aligned} f(x)&= 4\sqrt[3]{x} \\\\ y &= 4\sqrt[3]{x} &&\small{\gray{\text{Replace f(x) with y}}}\\\\ \dfrac{y}{4} &=\sqrt[3]{x}&&\small{\gray{\text{Divide both sides by 4}}}\\\\ \left(\dfrac{y}{4}\right)^3&=x&&\small{\gray{\text{Cube both sides}}} \\\\ \left(\dfrac{y}{4}\right)^3&=f^{-1}(y)&&\small{\gray{\text{Replace x with }f^{-1}(y)}} \\\\ \end{aligned}
yxx
f, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals, left parenthesis, start fraction, x, divided by, 4, end fraction, right parenthesis, cubedf, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals, start fraction, x, cubed, divided by, 64, end fraction

4) Rational functions

Find the inverse of g, left parenthesis, x, right parenthesis, equals, start fraction, x, minus, 3, divided by, x, minus, 2, end fraction.
g, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals 
g, left parenthesis, x, right parenthesisyx
\begin{aligned} g(x)&= \dfrac{x-3}{x-2} \\\\\\ y&= \dfrac{x-3}{x-2} &&\small{\gray{\text{Replace g(x) with y}}}\\\\\\ y(x-2) &= x-3 &&\small{\gray{\text{Multiply both sides by x-2}}}\\\\ yx-2y&= x-3 &&\small{\gray{\text{Distribute}}} \\\\ yx-x&=2y-3&&\small{\gray{\text{Group terms with x on one side}}}\\\\ x(y-1)&=2y-3&&\small{\gray{\text{Factor out an x}}}\\\\ x&=\dfrac{2y-3}{y-1} &&\small{\gray{\text{Divide both sides by y-1}}}\\\\ g^{-1}(y)&=\dfrac{2y-3}{y-1} &&\small{\gray{\text{Replace x with }g^{-1}(y)}}\end{aligned}
yxx
g, start superscript, minus, 1, end superscript, left parenthesis, x, right parenthesis, equals, start fraction, 2, x, minus, 3, divided by, x, minus, 1, end fraction

5) Challenge problem

Match each function with the type of its inverse.
Function
Inverse type
  • f, left parenthesis, x, right parenthesis, equals, 3, x, minus, 5
  • g, left parenthesis, x, right parenthesis, equals, x, cubed, minus, 7
  • h, left parenthesis, x, right parenthesis, equals, start fraction, x, plus, 2, divided by, x, minus, 3, end fraction
  • j, left parenthesis, x, right parenthesis, equals, square root of, x, plus, 2, end square root
  • Quadratic
  • Cube root
  • Linear
  • Rational