C2 st lecture 13 revision for test b handout

30
Lecture 13 - Revision for Test B C2 Foundation Mathematics (Standard Track) Dr Linda Stringer Dr Simon Craik [email protected] [email protected] INTO City/UEA London

Transcript of C2 st lecture 13 revision for test b handout

Page 1: C2 st lecture 13   revision for test b handout

Lecture 13 - Revision for Test BC2 Foundation Mathematics (Standard Track)

Dr Linda Stringer Dr Simon [email protected] [email protected]

INTO City/UEA London

Page 2: C2 st lecture 13   revision for test b handout

Outline

Lecture 8Pythagoras’ Theorem and TrigonometrySine and Cosine rules, Areas

Lecture 9Probability

Lecture 10Mode, Median and Interquartile rangeMean, Absolute deviation, Standard deviationZ-test

Lecture 11T-test

Lecture 12χ2 -test

Page 3: C2 st lecture 13   revision for test b handout

Pythagoras’ Theorem

I Only works in right-angled triangles.

a

bc

I

a2 + b2 = hyp2

Page 4: C2 st lecture 13   revision for test b handout

sin, cos and tan ratios

I Only works in right-angled triangles.

opp

adjhyp A

tan(A) =oppadj

cos(A) =adjhyp

sin(A) =opphyp

Page 5: C2 st lecture 13   revision for test b handout

Angle rule

I Works in any triangle.

a

bc

B C

A

I

A + B + C = 180

Page 6: C2 st lecture 13   revision for test b handout

Sine rule

I Works in any triangle.

a

bc

B C

A

I

asin A

=b

sin B=

csin C

Page 7: C2 st lecture 13   revision for test b handout

Cosine rule

I Works in any triangle.

a

bc

B C

A

I

a2 = b2 + c2 − 2bc cos(A)

Page 8: C2 st lecture 13   revision for test b handout

Area

I Works in any triangle.

a

bc

B C

A

I

Area =12

ab sin(C)

Page 9: C2 st lecture 13   revision for test b handout

Probability

I The sum of all probabilities is 1.I The probability an event A happens is denoted P(A) and is

a number between 0 and 1.I The probability A does not happen is 1− P(A).I The probability A and B happens is P(A)× P(B).I The probability A or B happens is P(A) + P(B).

Page 10: C2 st lecture 13   revision for test b handout

Probability trees

I You can use a probability tree when there is more than oneevent.

I Draw different tiers of branches for different events, andwrite the probability next to the branch.

I Multiply probabilities along the branches (AND)I Add up the probabilities at the end of each branch (OR)I The total of all the probabilities at the end of the branches

should be 1I The probabilities for the second tier may be the same as

for the first tier, or they may be different

Page 11: C2 st lecture 13   revision for test b handout

Probability tree - roll a fair die twice (or roll two fairdice)

What is the probability that I roll two fours?What is the probability that I roll no fours?What is the probability that I roll exactly one four?What is the probability that I roll at least one four?

First roll Second roll

P(4,4) = 16 ×

16 = 1

36

P(4,¬4) = 16 ×

56 = 5

36

P(¬4,4) = 56 ×

16 = 5

36

P(¬4,¬4) = 56 ×

56 = 25

36

¬4

¬4

5/6

41/65/6

4

¬4

5/6

41/6

1/6

Page 12: C2 st lecture 13   revision for test b handout

Mode

The mode is the most frequent object in your data.

X = 5 8 -3 7 8 2 8

The mode of X is 8.

Y = 0 2 1 6 5 1 2 3

The modes of Y are 1 and 2.

Page 13: C2 st lecture 13   revision for test b handout

Median

The median is the middle data.

X = 5 8 -3 7 8 2 8

Order the data

X = -3 2 5 7 8 8 8

7× 1/2 = 3.5

Round up to 4.The median of X is the fourth term 7.

Page 14: C2 st lecture 13   revision for test b handout

Median

Y = 0 2 1 6 5 1 2 3

Order the data

Y = 0 1 1 2 2 3 5 6

8× 1/2 = 4

Add the fourth term and the fifth term and divide by 2.The median of Y is 2+2

2 = 2.

Page 15: C2 st lecture 13   revision for test b handout

Interquartile range

I First order the data, with values increasing from left to right.I We want to find two values: the first quartile Q1 and the

third quartile Q3.I Let n be the size of the data set (the number of values).I To find Q1 we multiply n by 1

4 . If n4 is an integer (whole

number) then Q1 is the midpoint of the (n4 )th value and the

(n4 + 1)th value

I If n4 is not an integer then round it up to the nearest integer.

Q1 is the corresponding value.I To find Q3 we multiply n by 3

4 . If 3n4 is an integer then Q3 is

the midpoint of the (3n4 )th value and the (3n

4 + 1)th value

I If 3n4 is not an integer then round it up to the nearest

integer. Q3 is the corresponding value.I The interquartile range is Q3 −Q1.

Page 16: C2 st lecture 13   revision for test b handout

Interquartile range

The interquartile range is the middle half of the data. Take theordered data

X = -3 2 5 7 8 8 8

Find Q1 :7× 1/4 = 1.75

Round up to 2.The first quartile if X is the second term, Q1 = 2.Find Q3 :

7× 3/4 = 5.25

Round up to 6.The third quartile if X is the sixth term, Q3 = 8.The interquartile range is Q3 −Q1 = 8− 2 = 6

Page 17: C2 st lecture 13   revision for test b handout

Interquartile range

The interquartile range is the middle half of the data. Take theordered data

Y = 0 1 1 2 2 3 5 6

Find Q1 :8× 1/4 = 2

Add the second term and the third term and divide by 2.The first quartile of X is Q1 = 1+1

2 = 1.Find Q3 :

8× 3/4 = 6

Add the sixth term and the seventh term and divide by 2.The third quartile of X is Q3 = 3+5

2 = 4.The interquartile range is Q3 −Q1 = 4− 1 = 3

Page 18: C2 st lecture 13   revision for test b handout

Mean

The mean is the average of the data.

x̄ =

∑x

n

5 8 -3 7 8 2 8

x̄ =5 + 8 + (−3) + 7 + 8 + 2 + 8

7=

357

= 5

Page 19: C2 st lecture 13   revision for test b handout

Absolute deviation

The absolute deviation is the average distance of the data fromthe mean.

AD =

∑|x − x̄|

n

5 8 -3 7 8 2 8

Calculate |x − x̄| (remember that we calculated x̄ = 5)

0 3 8 2 3 3 3

Add these values together and divide by the number of valuesin the list

AD =0 + 3 + 8 + 2 + 3 + 3 + 3

7=

227

Page 20: C2 st lecture 13   revision for test b handout

Standard deviation

5 8 -3 7 8 2 8

The standard deviation, σ, is a measure of spread.First find the variance, σ2.

σ2 =

∑x2

n− x̄2

Calculate x2:

25 64 9 49 64 4 64

Add these values together, divide by the size of the data andsubtract the mean squared.

σ2 =2797− 52 =

1047

The standard deviation is the square root of the variance

σ = 3.85 to 2 d.p.

Page 21: C2 st lecture 13   revision for test b handout

Structure of hypothesis tests

The Z-test, the T-test and the χ2-test all have the samestructure

I Hypotheses (H0 and H1)I Critical value (look it up in a table, and for the Z-test and

T-test add a sketch showing rejection regions )I Test statistic (calculate)I Decision (accept/reject H0)I Conclusion (write a sentence)

Page 22: C2 st lecture 13   revision for test b handout

The Z-test

I The question will tell you the population mean µ and thestandard deviation of the population σ. It may also give youinformation for your alternative hypothesis.

I Write your null hypothesis H0 and your alternativehypothesis H1.

I Read your critical value off the table.This will depend onyour significance level and your alternative hypothesis.

I You will be given a sample mean x̄ and the size of thesample data n. Calculate your test statistic.

Z =x̄ − Aσ/√

n

I Compare the test statistic and the critical value. Decide toaccept or reject the null hypothesis. Write a concludingsentence.

Page 23: C2 st lecture 13   revision for test b handout

Example

I The National Association of Florists say the perfectsunflower should be 90cm tall with a standard deviation of9.5cm. We grow 100 sunflowers with a mean height of 92cm. We want to see whether or not our sunflowers areperfect to a 5% level of significance.

I H0 : µ = 90.H1 : µ 6= 90.

I We are doing a 2-tailed test. Reading off our table we getcritical values of −1.96 and 1.96.

I The test statistic is 92−909.5/

√100

= 2.11 to 2 d.p.

I The test statistic 2.11 is bigger than the critical value 1.96so we decide to reject the null hypothesis.

I We conclude that our sunflowers are not perfect.

Page 24: C2 st lecture 13   revision for test b handout

The T-testI The question will tell you the population mean µ. It will also

give you a small table of size n with some data. It may alsogive you information for your alternative hypothesis.

I Write your null hypothesis H0 and your alternativehypothesis H1.

I Read your critical value off the table.This will depend onyour significance level, your alternative hypothesis and thedegree of freedom of your data.

I You will calculate the sample mean x̄ and the samplestandard deviation s. Calculate your test statistic.

T =x̄ − A

s/√

n

I Compare the test statistic and the critical value. Decide toaccept or reject the null hypothesis. Write a concludingsentence.

Page 25: C2 st lecture 13   revision for test b handout

ExampleI The National Association of Florists say the perfect

sunflower should be 90cm tall. We grow 8 sunflowers.

90 93 87 86 50 92 95 93

We want to see whether our sunflowers are too short at a5% level of significance.

I H0 : µ = 90.H1 : µ < 90.

I We are doing a 1-tailed test, our degrees of freedom is8− 1 = 7. Reading off our table we get a critical value of−1.90.

I The sample mean is 86 and the sample standard deviationis 13.01. It follows the test statistic is −0.87.

I The test statistic −0.87 is bigger than the critical value−1.90 so we decide to accept the null hypothesis.

I We conclude that our sunflowers are perfect.

Page 26: C2 st lecture 13   revision for test b handout

The χ2-testI The question will give you a table.I Write your null hypothesis H0 that the variables are

independent and your alternative hypothesis H1 that thevariables are dependent.

I Read your critical value off the table.This will depend onyour significance level and the degrees of freedom of yourdata (n − 1)(m − 1).

I Calculate the row and column totals of the observed table.I Calculate the expected table. Row total times column total

divide by grand total.I Calculate the residual table. Observed minus expected.I Calculate the χ2 table. Residual value squared divided by

the expected value.I Calculate the test statistic. Add all the values in the χ2

table.I Compare the test statistic and the critical value. Decide to

accept or reject the null hypothesis. Write a concludingsentence.

Page 27: C2 st lecture 13   revision for test b handout

ExampleI The Institute for Studies want to know if the weather and

peoples happiness is independent to a 1% level ofsignificance. They collect the following data.

Happy Indifferent SadRain 4 9 20Snow 15 2 10Sun 25 12 3

I H0 : The weather and people’s happiness are independent.H1 : People’s happiness depends on the weather.

I Calculate the totals.

Happy Indifferent Sad Row totalRain 4 9 20 33Snow 15 2 10 27Sun 25 12 3 40

Column total 44 23 33 100

Page 28: C2 st lecture 13   revision for test b handout

Example

I Calculate the expected table (to 3 d.p.).

14.52 7.59 10.8911.88 6.21 8.9117.6 9.2 13.2

I Calculate the residual table (to 3 d.p.).

-10.52 1.41 9.113.12 -4.21 1.097.4 2.8 -10.2

Page 29: C2 st lecture 13   revision for test b handout

Example

I Calculate the χ2 table (to 3 d.p.).

7.623 0.262 7.6210.819 2.854 0.1333.111 0.8 7.882

I The test statistic is 31.10 to 2 d.p.I The degree of freedom is (3− 1)× (3− 1) = 4. Our critical

value is 13.28.I Our test statistic is greater than our critical value so we

decide to reject our null hypothesis.I People’s happiness depends on the weather.

Page 30: C2 st lecture 13   revision for test b handout

Standard Track Test B will be held during theweek beginning 21 April