In this Promblem you are should graphically obtain the pdf p
In this Promblem you are should graphically obtain the pdf (probability distribution function) of 3 discrete distributions by repeating the random experiment multiple times and normalizing the results. Using Met lab. The program have to perform a random experiment to obtain the fallowing.
a) User should select one of the following distribution from the initial menu:
- Uniform
- Binomial
- Geometric
b) After selecting a distribution from the list, the user should be given the option of assigning values to its parameters:
-Uniform: initial value ‘a’ and the final value ‘b’.
-Binomial: the probability of success ‘p’ and the total number of Bernoulli experiments ‘n’.
-Geometric: the probability of success‘p’
c) In each case the user selects the total number of repetitions for each case ‘R’. This value should be set to 10, 1000 and 10000 in your results.
d) In each case, your program should repeat the experiment R times and plots the pdf of the distribution. The mean and variance needs to be calculated form the generated data and printed on the graph.
e) The theoretical values for the mean, variance and the pdf needs to be calculated and shown.
Hint- in this program we will be using random variable function to obtain the numbers for the graph. We have put each instruction Uniform, Binomial and Geometric into a loop, for example 10 times to get the data and then take the data and put it into a graph form.
Solution
A)
Now let
X
be the number of Heads observed. Then
X
has support
S
X
=
{
0
,
1
,
2
,
3
}
.Assuming
that the coin is fair and was tossed in exactly the same way eac
htime,itisnotunreasonable
to suppose that the outcomes in the sample space are all equal
ly likely. What is the PMF of
X
?NoticethatXis zero exactly when the outcome TTToccurs, and this event has probability1/8. Therefore,fX(0)=1/8, and the same reasoning shows thatfX(3)1/8. Exactly threeoutcomes result inX=1, thus,fX(1)=3/8andfX(3) holds the remaining 3/8probability(the total is1).

