Lets say I have a random variable X that can take values 1,2,3,4 and 5 with probabilities 0.2 0.3 0.1 0.25 0.10 0.05.
My question is how I can determine the Cumulative distribution function and how I can use it to generate the numbers from X?
Lets say I have a random variable X that can take values 1,2,3,4 and 5 with probabilities 0.2 0.3 0.1 0.25 0.10 0.05.
My question is how I can determine the Cumulative distribution function and how I can use it to generate the numbers from X?
I will get you started on the CDF:
$\displaystyle \[
P\left( {X \leqslant b} \right) = F(b) = \left\{ {\begin{array}{rl}
{0,} & {b < 1} \\
{0.2,} & {1 \leqslant b < 2} \\
{0.5,} & {2 \leqslant b < 3} \\
{?,} & {3 \leqslant b < 4} \\
?, & ? \\
?, & ? \\ \end{array} } \right.$
I'm inclined to suggest to the OP that s/he make a spinner, with the area for each number weighted according to the probability of that number occuring.
Memo to OP: The usefulness of the help you get is directly proportional to the accuracy and clarity of the question you post.