A random variable can be thought of as a function that maps the points of the sample space into the set of real numbers.
Continuous Random Variable:
A continuous random variable is one in which the probability is spread continuously over intervals of real numbers. Eg height, weight, time etc.
Discrete Random Variable:
A discrete random variable is one which the possible values are countable. Its probability is concentrated on a finite or countably infinite set of real numbers. Eg the random variable representing the number of people with black hair in a group of 20, has probability concentrated on the points 0,1,2,..., 20.
Definition 2.1-1:Probability Mass Function
The probability mass function of a discrete random variable X is the function that assigns a probability to each of the possible values of X. The probability mass function X is denoted as p(x) and is defined by p(x) = P (X=x) .
Consider rolling a dice 3 times. Let the random variable X denote the number times the dice rolls a 2. The probability mass function p(x) is given below.
Definition 2.1-2: Cumulative Distribution Function (CDF)
For each real number x, the function F(X)= P(X £ x ) is called the cumulative distribution function of X. F(x) is probability that X is less than or equal to x.
For example, if X has a probability mass function P(X = x) then F(x) = P(X £ x) = SP(X = x). So for each value of X that is less than or equal to x, find the probability of X at that value and sum up the results.
Example 2:
Lets consider Example 1 again. F(x) for x=0,1,2 and 3 are:
F(0)
P(X £ 0)= P( zero or fewer 2's)= 125/216
F(1)
P(X £ 1)= P( One or fewer 2's)=(125+216)+(75/216) =200/216
F(2)
P(X £ 2)= P( Two or fewer 2's) =(125+216)+(75/216)+(15/216)=215/216
F(3)
P(X £ 3)= P(Three or fewer 2's) =(125+216)+(75/216)+(15/216)=216/216
It is possible to compute F(x) for values of x not equal to 0,1,2, or 3. Although p(2.5)=0,
F(2.5)=P(X £ 2.5)=P(2.5 or fewer 2's)
=p(0)+p(1)+p(2)
=125/216 +75/216 + 15/216
=215/216
The cumulative distribution function in the discrete case is a step function. The size of the step at x is equal to the probability mass function p(x).
The size of the step at x =1 is 200/216 -125/216 = 75/216 = p(1)
A multiple choice test has three possible answers for each question, one of which is correct. Let X denote the number of correct answers in an exam consisting of four questions. Find the probability mass function of X and the cumulative distribution of X, assuming the student guesses on each question.