Download File: Lab3.xls, Worksheet: Probability

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Central limit theorem wikipedia , lookup

Transcript
73-105 Business Data Analysis I
Computer Lab 2
Fall 2001
Ex 1: Exercise on Probability Distribution
File: Lab3.xls, Worksheet: Probability
Goal: To learn some Excel functions for Binomial, Poisson and Normal distributions.
1. Binomial: find probability of c successes from n trials if P(success) = p
 P(k successes) = BINOMDIST(k,n,p,FALSE)
2. Binomial: find probability of k or fewer successes from n trials if P(success) = p
 P(k or fewer successes) = BINOMDIST(k,n,p,TRUE)
3. Poisson: find probability of k arrivals if mean number of arrivals = 
 P(k arrivals) = POISSON(k,,FALSE)
4. Poisson: find probability of k or fewer arrivals if mean number of arrivals = 
 P(k or fewer arrivals) = POISSON (k,,FALSE)
5. Normal: find area from normal distribution variate z
 Area on the left of z, (z) = NORMSDIST(z)
6. Normal: find normal distribution variate z from area, (z)
 z = NORMSINV(Area on the left of z)
7. Normal: find area from normal distribution variable x
 Area on the left of x = NORMDIST(x,,,TRUE)
8. Normal: find normal distribution variable x from area
 x = NORMINV(Area on the left of x,,)
Questions
Find
1. probability(exactly 1 success) if p=0.4, n=3
2. probability(0 or 1 success) if p=0.4, n=3
3. probability(exactly 1 arrival) if =2
4. probability(0 or 1 arrival) if =2
5. area (under normal curve) on the left of z = 2.5
6. z corresponding to the area (under normal curve) on the left = 0.4
7. the area (under normal curve) on the left if x=600, =300 and =120
8. x if the area (under normal curve) on the left =0.4, =300 and =120
Note: The Excel function for the exponential distribution is EXPONDIST. It takes 3
arguments x, , and True/False.
1
Ex 2: Exercise on Binomial Approximation
File: Lab3.xls, Worksheet: Approximation
Goal: Binomial distribution can be approximated by Normal or Poisson distributions. The
Normal distribution is more appropriate for large value of p and Poisson approximation is
more appropriate for small value of p.
Steps
1. Compute binomial probabilities P X  x  for x  0,1,2,,15 . Type the formula
shown below in cell B7. Copy B7 to cells B8:B22.
2. Construct a scatter plot showing x on the horizontal axis and P X  x  on the
vertical axis.
3. Compute Poisson probabilities f x  for x  0,1,2,,15 . Type the formula shown
below in cells C3 and C7. Copy C7 to cells C8:C22.
4. Add another series that shows Poisson probabilities computed in Step 4 on the scatter
plot constructed in Step 3
5. Compute normal probabilities f x  for x  0,1,2,,15 . Type the formula shown
below in cells D3, D4 and D7. Copy D7 to cells D8:D22.
6. Add another series that shows normal probabilities computed in Step 6 on the scatter
plot constructed in Steps 3 and 5.
7. Change the value of p several times and each time see the corresponding change on
the scatter plot. For each p, check which of the Poisson distribution and normal
distribution resembles binomial distribution more closely. It is expected that for
smaller p values Poisson will resemble binomial more closely and for larger p values
Normal will resemble binomial more closely.
The formula and the resulting graph are shown below:
A
15
n
0.1
p
Mean
Standard Deviation
x
0
1
15
B
C
D
=B1*B2
Binomial
f (x )
=BINOMDIST(A7,$B$1,$B$2,FALSE)
=BINOMDIST(A8,$B$1,$B$2,FALSE)
=BINOMDIST(A22,$B$1,$B$2,FALSE)
=B1*B2
=SQRT(B1*B2*(1-B2))
Poisson
Normal
f (x )
f (x )
=POISSON(A7,$C$3,FALSE) =NORMDIST(A7,$D$3,$D$4,FALSE)
=POISSON(A8,$C$3,FALSE) =NORMDIST(A8,$D$3,$D$4,FALSE)
=POISSON(A22,$C$3,FALSE) =NORMDIST(A22,$D$3,$D$4,FALSE)
Binomial and Approximation
Probability
1
2
3
4
5
6
7
8
22
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
Binomial
Normal
Poisson
0
5
10
15
Number of Successes
2
Ex 3: Exercise on Variation of Sample Mean
File: Lab3.xls, Worksheet: Sample_Mean
Goals:
 Central Limit Theorem: If a random sample is drawn from any population, the
sampling distribution of the sample mean is approximately normal for a sufficiently
large sample size. The larger the sample size, the more closely the sampling
distribution of x will resemble a normal distribution.
 If the sample size increases, the variation of the sample mean decreases.
 x   ,  x2 
2
n
, 

n
Where,
 = Population mean
 = Population standard deviation
n = Sample size
 x = Mean of the sample means
 x = Standard deviation of the sample means
Steps
1. Random Numbers: Generate 1000 random numbers: Type the following in cell A7:
=RAND()
Copy and paste the above formula to A8:A1006 as follows: click cell A7, click Edit,
Copy, click cell A8, click Edit, Go To. Go To window pops up. There is a box
labelled Reference. Type A1006 in that box. Press SHIFT+ENTER. The cells
A8:A1006 are highlighted. Click Edit, Paste. The formula is copied to cells
A8:A1006.
2. Statistics: Compute mean  , variance  2 and standard deviation  in cells I2, I3 and
I4 respectively.
Cell
Formula
I2
=AVERAGE(A7:A1006)
Mean, 
2
I3
=VAR(A7:A1006)*1000/999
Variance, 
I4
=SQRT(I3)
Standard deviation, 
3. Class Numbers: Now, a relative frequency distribution of the random numbers will be
generated. The method that will be used to generate the relative frequency
distributions is different from the method used in Lab 1. 50 class intervals are listed in
cells E7:G56. We shall compute frequency and relative frequency of each class
interval. To do this we need an intermediate step. For every random number, the class
number will be generated. Type the following in cell B7:
=VLOOKUP(A7,$E$7:$G$56,3)
Copy and paste the above formula to B8:B1006.
4. Frequencies: Type the following in cell H7:
=COUNTIF(B$7:B$1006,$G7)
Copy and paste the above formula to H8:H56
3
5. Relative Frequencies: Type the following in cell I7:
=H7/1000
Copy and paste the above formula to I8:I56
6. Relative Frequency Histogram: Construct a relative frequency histogram showing
class numbers on the horizontal axis and relative frequencies on the vertical axis. It is
expected that the histogram will show an uniform distribution.
7. Random Numbers: Generate 1000 random numbers again. However, this step is
different from Step 1 because each random number will be a mean of 4 random
numbers: Type the following in cell c7:
=SUM(A7,RAND(),RAND(),RAND())/4
Copy and paste the above formula to A8:A1006
8. Statistics: Compute mean  x , variance  x2 and standard deviation  x in cells K2, K3
and K4 respectively.
Cell
Formula
K2
=AVERAGE(C7:C1006)
Mean,  x
Variance,  x2
K3
=VAR(C7:C1006)*1000/999
Standard deviation,  x
K4
=SQRT(K3)
It is expected that the numbers obtained in Step 8 are the nearly the same as the
numbers obtained using the following formulae with n  4.
 x   ,  x2 
2
, 

n
n
9. Class Numbers: Copy the formula in cell B7 and paste it to cells D7:D1006.
10. Frequencies: Copy the formula in cell H7 and paste it to cells J7:D56.
11. Relative Frequencies: Copy the formula in cell I7 and paste it to cells K7:K56.
12. Relative Frequency Histogram: Add another series that shows relative frequencies
computed in cells K7:K56 on the scatter plot constructed in Step 3
Sample Size and Mean
Class Number
Class Number
4
49
45
41
37
33
29
25
21
17
9
13
5
0.08
0.07
0.06
0.05
0.04
0.03
0.02
0.01
0
1
49
45
41
37
33
29
25
21
17
9
13
5
Relative Frequency
0.08
0.07
0.06
0.05
0.04
0.03
0.02
0.01
0
1
Relative Frequency
Sample Size and Mean