Skip to main content

4.1a Probability Distributions for Discrete Random Variables

 

Probability Distributions
Associated to each possible value $x$ of a discrete random variable $X$ is the probability $P(x)$ that $X$ will take the value $x$ in one trial of the experiment.

Definition

The probability distribution of a discrete random variable $X$(probability mass function) is a list of each possible value of $X$ together with the probability that $X$ takes that value in one trial of the experiment.

The probabilities in the probability distribution of a random variable X must satisfy the following two conditions:
Each probability $P(x)$ must be between 0 and 1: $0≤P(x)≤1.0$
The sum of all the probabilities is 1: $\sum P(x)=1.$

Example:
A fair coin is tossed twice. Let $X$ be the number of heads that are observed.

a.Construct the probability distribution of $X$.
b.Find the probability that at least one head is observed

The possible values that $X$ can take are 0, 1, and 2. Each of these numbers corresponds to an event in the sample space $S={hh,ht,th,tt}$ of equally likely outcomes for this experiment: $X = 0$ to ${tt}$, $X = 1$ to ${ht,th}$, and $X = 2$ to ${hh}$. The probability of each of these events, hence of the corresponding value of $X$, can be found simply by counting, to give
x         0       1       2
P(x) 0.25   0.50   0.25
This table is the probability distribution of X

 
b. “At least one head” is the event $X \ge 1$, which is the union of the mutually exclusive events
$X=1$ and $X=2$. Thus $P(X\ge 1)=P(1)+P(2)=0.50+0.25=0.75$
The histogram that graphically illustrate the probability distribution is given below

The Mean and Standard Deviation of a Discrete Random Variable

Definition
The mean (also called the expected value) of a discrete random variable $X$ is the number
$\mu=E(X)=\sum x P(x)$

The mean of a random variable may be interpreted as the average of the values assumed by the random variable in repeated trials of the experiment.

Find the mean of the discrete random variable $X$ whose probability distribution is
Solution:
The formula in the definition gives

$E(x)=\mu=\sum x.P(x)$
$=-2\times0.21 +  1\times0.34 + 2\times0.24 + 3.5\times0.21=1.135$

Variance and Standard Deviation

The variance, $\sigma^2$, of a discrete random variable $X$ is the number

$Var[X]=\sigma^2=\sum(x-\mu)^2 P(x)$

which by algebra is equivalent to the formula
$\sigma^2=[\sum x^2 P(x)]−\mu^2=E[X^2]-E[X]^2$

The standard deviation, $\sigma$, of a discrete random variable $X$ is the square root of its variance, hence is given by the formulas
$\sigma=\sqrt{\sum(x-\mu)^2P(x)}=\sqrt{\left[\sum x^2P(x)\right]-\mu^2}$

Example:
A discrete random variable $X$ has the following probability distribution:

x          -1        0    1    4
P(x)    0.2     0.5   a   0.1

Compute each of the following quantities.
  1. Find $a$.
  2. Find $P(0)$
  3. Find $P(X > 0)$
  4. Find $P(X ≥ 0)$
  5. Find $P(X≤−2)$
  6. The mean $\mu$ of $X$
  7. The variance $\sigma^2$ of $X$.
  8. The standard deviation $\sigma$ of $X$.

Solutions
1.Since all probabilities must add up to 1
a=1-0.2-0.5-0.1
a=0.2

2.P(0)=0.5

3.$P(X >0)=P(1)+P(4)=0.2 + 0.1=0.3$.

4.$P(X≥0)=P(0)+P(1)+P(4)=0.5+0.2+0.1=0$.

5.$P(X\le -2)=0$

6.Using the formula in the definition of $\mu$,
$\mu=\sum x P(x)=(−1)\times 0.2+0\times0.5+1\times 0.2+4\times0.1=0.4$

7.Using the formula in the definition of $\sigma^2$ and the value of $\mu$ that was just computed,

$\sigma^2=\sum (x-\mu)^2P(x)=(−1−0.4)^2 \times 0.2+(0−0.4)^2 \times 0.5+(1−0.4)^2 \times 0.2+(4−0.4)^2 \times 0.1=1.84$

8.standard deviation is the square root of the variance
$\sigma=\sqrt{1.84}=1.3565$

A random variable $R$ has the probability distribution as shown in the following table:
 r           1        2        3        4           5
p(R=r) 0.2      a        b        0.25    0.15

i. Given that E(R)=2.85, find a and b.
ii. Find P(R>2).

i. $E(R)=2.85=1\times 0.2+2\times a+ 3 \times b + 4 \times 0.25 + 5 \times 0.15$
$2.85=0.2+2a+3b+1+0.75$
$0.9=2a+3b$----(1)
The probabilities must add upto 1
$1=0.2+a+b+0.25+0.15$
$0.4=a+b$
$0.8=2a+2b$-----(2)

(1)-(2)
$0.1=b$
$a+b=0.4$
So
$a=0.4-b=0.4-0.1=0.3$
Answer ; $a=0.3,b=0.1$

ii. $P(R>2)=P(3)+P(4)+P(5)=0.1+0.25+0.15=0.5$

Binomial Distribution
Consider the experiment of tossing a fair coin 3 times. The outcomes are
{TTT,HTT,THT,TTH,HHT,THH,HTH,HHH}
The probability distribution is( considering the number of heads)
        0       1       2       3
P(x)      1/8   3/8    3/8    1/8
we perform three identical and independent trials of the same action, each trial has only two outcomes (heads or tails), and the probability of success is the same number, 0.5, on every trial.The random variable that is generated is called the binomial random variable with parameters $n = 3$ and $p = 0.5$. This is just one case of a general situation.


Definition

Suppose a random experiment has the following characteristics.

There are $n$ identical and independent trials of a common procedure.
There are exactly two possible outcomes for each trial, one termed “success” and the other “failure.”
The probability of success on any one trial is the same number $p$.

Then the discrete random variable $X$ that counts the number of successes in the $n$ trials is the binomial random variable with parameters $n$ and $p$. We also say that $X$ has a binomial distribution with parameters $n$ and $p$.


Probability Formula for a Binomial Random Variable

Often the most difficult aspect of working a problem that involves the binomial random variable is recognizing that the random variable in question has a binomial distribution. Once that is known, probabilities can be computed using the following formula.


$P(X)=\binom{n}{x}p^xq^{n-x}$

where $q=1-p$

Special Formulas for the Mean and Standard Deviation of a Binomial Random Variable

Since a binomial random variable is a discrete random variable, the formulas for its mean, variance, and standard deviation given in the previous section apply to it, However, for the binomial random variable there are much simpler formulas.


If $X$ is a binomial random variable with parameters $n$ and $p$, then
$\mu=np$ $\sigma^2=npq$ $\sigma=\sqrt{npq}$

where $q=1-p$

The Cumulative Probability Distribution of a Binomial Random Variable

In order to allow a broader range of more realistic problems we can use probability tables for binomial random variables for various choices of the parameters $n$ and $p$. These tables are not the probability distributions that we have seen so far, but are cumulative probability distributions. In the place of the probability $P(x)$ the table contains the probability

$P(X \le x)=P(0)+P(1)+ ⋅ ⋅ ⋅ +P(x)$

The cumulative table is much easier to use for computing $P(X \le x)$ since all the individual probabilities have already been computed and added. The one table suffices for both $P(X≤x)$ or $P(X≥x)$ and can be used to readily obtain probabilities of the form $P(x)$, too


If $X$ is a discrete random variable, then
$P(X≥x)=1−P(X≤x−1)$  and $P(x)=P(X≤x)−P(X≤x−1)$

Example
A student takes a ten-question true/false exam.Find the probability that the student gets exactly six of the questions right simply by guessing the answer on every question.Find the probability that the student will obtain a passing grade of 60% or greater simply by guessing.

Solution:

Let $X$ denote the number of questions that the student guesses correctly. Then $X$ is a binomial random variable with parameters $n = 10$ and $p = 0.50$.

The probability sought is P(6). The formula gives
$P(6)=\frac{10!}{(6!)}(4!)(.5)^6(.5)^4=0.205078125$

Using the table,
$P(6)=P(X≤6)−P(X≤5)=0.8281−0.6230=0.2051$


The student must guess correctly on at least 60% of the questions, which is 0.60 x 10=6 questions. The probability sought is 
$P(X≥6)=P(6)+P(7)+P(8)+P(9)+P(10)$

Instead of computing each of these five numbers using the formula and adding them we can use the table to obtain
$P(X≥6)=1−P(X≤5)=1−0.6230=0.3770$
which is much less work and of sufficient accuracy for the situation at hand.

Example: University question

In a large consignment of electric bulbs 10% are known to be defective. A random sample of 20 is taken for inspection.Find the probability that
i) all are good bulbs
ii) exactly 3 are defective bulbs.

i) $20C20. ( 0.9)^{20}=0.1216$
ii)$20C3.(0.1)^3(0.9)^{17}=0.19$

Comments

Popular posts from this blog

Mathematics for Machine Learning- CST 284 - KTU Minor Notes - Dr Binu V P

  Introduction About Me Syllabus Course Outcomes and Model Question Paper Question Paper July 2021 and evaluation scheme Question Paper June 2022 and evaluation scheme Overview of Machine Learning What is Machine Learning (video) Learn the Seven Steps in Machine Learning (video) Linear Algebra in Machine Learning Module I- Linear Algebra 1.Geometry of Linear Equations (video-Gilbert Strang) 2.Elimination with Matrices (video-Gilbert Strang) 3.Solving System of equations using Gauss Elimination Method 4.Row Echelon form and Reduced Row Echelon Form -Python Code 5.Solving system of equations Python code 6. Practice problems Gauss Elimination ( contact) 7.Finding Inverse using Gauss Jordan Elimination  (video) 8.Finding Inverse using Gauss Jordan Elimination-Python code Vectors in Machine Learning- Basics 9.Vector spaces and sub spaces 10.Linear Independence 11.Linear Independence, Basis and Dimension (video) 12.Generating set basis and span 13.Rank of a Matrix 14.Linear Mapping and Matri

1.1 Solving system of equations using Gauss Elimination Method

Elementary Transformations Key to solving a system of linear equations are elementary transformations that keep the solution set the same, but that transform the equation system into a simpler form: Exchange of two equations (rows in the matrix representing the system of equations) Multiplication of an equation (row) with a constant  Addition of two equations (rows) Add a scalar multiple of one row to the other. Row Echelon Form A matrix is in row-echelon form if All rows that contain only zeros are at the bottom of the matrix; correspondingly,all rows that contain at least one nonzero element are on top of rows that contain only zeros. Looking at nonzero rows only, the first nonzero number from the left pivot (also called the pivot or the leading coefficient) is always strictly to the right of the  pivot of the row above it. The row-echelon form is where the leading (first non-zero) entry of each row has only zeroes below it. These leading entries are called pivots Example: $\begin

4.3 Sum Rule, Product Rule, and Bayes’ Theorem

 We think of probability theory as an extension to logical reasoning Probabilistic modeling  provides a principled foundation for designing machine learning methods. Once we have defined probability distributions corresponding to the uncertainties of the data and our problem, it turns out that there are only two fundamental rules, the sum rule and the product rule. Let $p(x,y)$ is the joint distribution of the two random variables $x, y$. The distributions $p(x)$ and $p(y)$ are the corresponding marginal distributions, and $p(y |x)$ is the conditional distribution of $y$ given $x$. Sum Rule The addition rule states the probability of two events is the sum of the probability that either will happen minus the probability that both will happen. The addition rule is: $P(A∪B)=P(A)+P(B)−P(A∩B)$ Suppose $A$ and $B$ are disjoint, their intersection is empty. Then the probability of their intersection is zero. In symbols:  $P(A∩B)=0$  The addition law then simplifies to: $P(A∪B)=P(A)+P(B)$  wh