Getting PDF and CDF from the outcome of an experiment

110 Views Asked by At

Knowing that my experiment can return results within $\{a, b, c\}$, so that any possible result has a density of $\frac{1}{3}$, and that executing the experiment three times returned the sequence $a, b, c$ so that distributions are $\{\frac13,\frac23,\frac33\}$, how can I get both PDF and CDF?

I couldn't find anything online and I've been requested to write a code that does this computation, but I'm not really into probability and stuff like that so I'd like some hints or the full algorithm if possible.

1

There are 1 best solutions below

2
On

Discrete results do not have a probability density; they have a probability mass.   Which is $\tfrac 1 3$

(PS: It's continuous valued random variables that have a probability density.)

The probability mass of three discrete results cannot all be $\tfrac 1 2$.   The sum of all possible probabilities must equal $1$.   So if they are equal, then they must all be $\tfrac 1 3$. (ed: as you noted that was a typo in the OP.)

That is the Probability Mass Function (pmf).   $p(x) = \begin{cases} \tfrac 1 3 & : x\in\{a,b,c\} \\ 0 & :\text{otherwise}\end{cases}$

A Cumulative Distribution Function (CDF) is exactly what it sounds like: the accumulated probabilities of outcomes in the distribution up to a certain value.   $F(x) = \Pr(X\leq x)$ .   As such it only makes sense for a strictly ordered set of results.   However, if we can say the set is ordered so that $a < b < c$, then we can say : $F(a)=p(a)\\ F(b)=p(a)+p(b)\\ F(c)=p(a)+p(b)+p(c)$

The CDF is then: $$F(x) = \begin{cases} 0 & : x<a \\ 1/3 & : a\leq x< b \\ 2/3 & : b\leq x< c \\ 1 & : c\leq x\end{cases}$$