Download presentation

Presentation is loading. Please wait.

Published byAshton Weld Modified over 2 years ago

1
One of the biggest studies of "public service" television has shown people rate impartial news highly and see benefit in soap operas. The report by communications regulator Ofcom is the first stage of a review which could shape the future output of the BBC and commercial broadcasters. It examines how much society gains from the five main terrestrial channels. The study shows viewers value accurate, impartial news and believe soaps help depict social issues.

4
Trend In Audience Share Of ITV1 & BBC One Regional News

5
Profile of channels: age and social grouping 4

8
Example A student attempts a multiple choice exam (options A to F for each question), but having done no work, selects his answers to each question by rolling a fair die (A = 1, B = 2, etc.). If the exam contains 100 questions, what is the probability of obtaining a mark below 20?

9
This is a typical application of the Binomial Distribution. a,the probability of a correct answer (success), is given by symmetry as n=100

10
The probability of the student obtaining a mark below 20 is the sum of p(0), p(1), p(2)…….p(19). As an example, consider obtaining a score of 15. The result calculates as 0.08742

11
Now we will use R to calculate all the probabilities > dbinom(0:19,100,1/6) [1] 1.207467e-08 2.414935e-07 2.390785e-06 1.561980e-05 [5] 7.575602e-05 2.909031e-04 9.211932e-04 2.474062e-03 [9] 5.752193e-03 1.176004e-02 2.140327e-02 3.502354e-02 [13] 5.195158e-02 7.033445e-02 8.741567e-02 1.002366e-01 [17] 1.065014e-01 1.052485e-01 9.706247e-02

12
Notice that, for example, 8.741567e-02 = 8.741567 x 10 -2 = 0.08741567 This is the same result that was calculated before.

13
We need now to add up all these probabilities > dbinom(0:39,100,1/6) [1] 1.207467e-08 2.414935e-07 2.390785e-06 1.561980e-05 [5] 7.575602e-05 2.909031e-04 9.211932e-04 2.474062e-03 [9] 5.752193e-03 1.176004e-02 2.140327e-02 3.502354e-02 [13] 5.195158e-02 7.033445e-02 8.741567e-02 1.002366e-01 [17] 1.065014e-01 1.052485e-01 9.706247e-02

14
The easiest thing is to make the answer to the command you’ve typed on R, equal to a vector, which will then contain all the answers displayed on the screen. Use >x= dbinom(0:19,100,1/6)

15
> x [1] 1.207467e-08 2.414935e-07 2.390785e-06 1.561980e-05 [5] 7.575602e-05 2.909031e-04 9.211932e-04 2.474062e-03 [9] 5.752193e-03 1.176004e-02 2.140327e-02 3.502354e-02 [13] 5.195158e-02 7.033445e-02 8.741567e-02 1.002366e-01 [17] 1.065014e-01 1.052485e-01 9.706247e-02 8.378024e-02 >

16
In fact, all data entered into R is a vector - the numbers in square brackets tell you how far “down” the vector you are. So this vector x is equal to:

17
x =

18
So now to calculate the probability of obtaining less than 20 in the exam, add up all the individual values in this vector. In R, this can easily be done with the “sum” command. > x=dbinom(0:19,100,1/6) > x [1] 1.207467e-08 2.414935e-07 2.390785e-06 1.561980e-05 [5] 7.575602e-05 2.909031e-04 9.211932e-04 2.474062e-03 [9] 5.752193e-03 1.176004e-02 2.140327e-02 3.502354e-02 [13] 5.195158e-02 7.033445e-02 8.741567e-02 1.002366e-01 [17] 1.065014e-01 1.052485e-01 9.706247e-02 8.378024e-02 > sum(x) [1] 0.7802502 >

19
> x=dbinom(0:19,100,1/6) > x [1] 1.207467e-08 2.414935e-07 2.390785e-06 1.561980e-05 [5] 7.575602e-05 2.909031e-04 9.211932e-04 2.474062e-03 [9] 5.752193e-03 1.176004e-02 2.140327e-02 3.502354e-02 [13] 5.195158e-02 7.033445e-02 8.741567e-02 1.002366e-01 [17] 1.065014e-01 1.052485e-01 9.706247e-02 8.378024e-02 > sum(x) [1] 0.7802502 > So the probability of obtaining less than 20 in the exam is 0.7803.

20
Note that if you do not need individual probabilities or bar-charts, there is a simple way of obtaining the sum of all the individual probabilities up to and including 19. > pbinom(19,100,1/6) [1] 0.7802502 > pbinom gives cumulative probabilities.

21
Let us now consider some other properties of the Binomial distribution. The mean score in the exam is given by : sample size x probability of success = na This calculates as 100 x (1/6) = 16.67 So we would expect the probabilities to be largest around 16 and 17. Consider a bar graph:

23
The command is quite simply: > barplot(x, names=0:19) This gives the expected results. The mean can also be calculated from first principles. This is given by :

24
The complete distribution is generated as shown below: > y=dbinom(0:100,100,1/6) > y [1] 1.207467e-08 2.414935e-07 2.390785e-06 1.561980e-05 7.575602e-05 2.909031e-04 [7] 9.211932e-04 2.474062e-03 5.752193e-03 1.176004e-02 2.140327e-02 3.502354e-02 [13] 5.195158e-02 7.033445e-02 8.741567e-02 1.002366e-01 1.065014e-01 1.052485e-01 [19] 9.706247e-02 8.378024e-02 6.786200e-02 5.170438e-02 3.713314e-02 2.518596e-02 [25] 1.616099e-02 9.825882e-03 5.668778e-03 3.107330e-03 1.620251e-03 8.045383e-04 [31] 3.808148e-04 1.719809e-04 7.416675e-05 3.056569e-05 1.204648e-05 4.543243e-06 [37] 1.640616e-06 5.675643e-07 1.881924e-07 5.983553e-08 1.824984e-08 5.341415e-09 [43] 1.500683e-09 4.048355e-10 1.048892e-10 2.610576e-11 6.242681e-12 1.434488e-12 [49] 3.167828e-13 6.723554e-14 1.371605e-14 2.689422e-15 5.068526e-16 9.180726e-17 [55] 1.598126e-17 2.673229e-18 4.296262e-19 6.632825e-20 9.834878e-21 1.400220e-21 [61] 1.913634e-22 2.509684e-23 3.157344e-24 3.808860e-25 4.403994e-26 4.878270e-27 [67] 5.173923e-28 5.251146e-29 5.096700e-30 4.727374e-31 4.187103e-32 3.538397e-33 [73] 2.850375e-34 2.186589e-35 1.595619e-36 1.106296e-37 7.278263e-39 4.537099e-40 [79] 2.675725e-41 1.490277e-42 7.823955e-44 3.863682e-45 1.790487e-46 7.765966e-48 [85] 3.143367e-49 1.183385e-50 4.128088e-52 1.328580e-53 3.925350e-55 1.058521e-56 [91] 2.587497e-58 5.686806e-60 1.112636e-61 1.914213e-63 2.850955e-65 3.601206e-67 [97] 3.751256e-69 3.093820e-71 1.894175e-73 7.653234e-76 1.530647e-78 >

25
The command sum(0:100*y) will produce the mean value as indicated by the formula : We will call this value m > m=sum(0:100*y) > m [1] 16.66667 >

26
Similarly the variance can be calculated by the command v = sum((0:100)^2*y) - m^2 > v=sum((0:100)^2*y)- m^2 > v [1] 13.88889 > This agrees with the value that would be calculated from the formula na(1-a)

27
Finally, check all the probabilities add up to 1 > sum(y) [1] 1 >

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google