8 pt 2
CP214: Discrete Structures
Chapter 7: Discrete Probability
Instructor: Dr. Shimaa Abdelmeguid
Outline of Topics
Probability Theory
Independence
Bernoulli Trials
Random Variables
Expected Values
Probability Theory
Independence
Definition:
The events E and F are independent if and only if the following equation holds:
Furthermore, the conditional probability of E given F is defined as:
Symmetrical property: If , then as well.
Independence Examples
Example 1: Rolling Dice
Let E be the event of rolling an even number with an unbiased die, while F is the event that the resulting number is divisible by three.
Events defined as:
E = {2, 4, 6}
F = {3, 6}
Calculate probabilities:
Verification:
:
Conclusion: E and F are independent.
Example 2: Bit Strings
Let E be the event where a random bit string of length four begins with a 1. Let F be the event the bit string contains an even number of 1s.
Possible bit strings starting with 1:
{1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111}
Possible bit strings with an even number of 1s:
{0000, 0011, 0101, 0110, 1001, 1010, 1100, 1111}
Calculate probabilities:
Total strings = 16
Verification:
Conclusion: E and F are independent.
Example 3: Family Children
For a family with two children, let E be the event of having two boys (BB) and F be the event of having at least one boy (BB, BG, GB).
E = {BB}, p(E) = 1/4
F = {BB, BG, GB}, p(F) = 3/4
Independence check:
Conclusion: E and F are not independent since .
Bernoulli Trials
Definition and Concepts
A Bernoulli trial is defined as a random experiment with two possible outcomes, commonly referred to as a success (S) or failure (F).
Let p be the probability of success, and q = 1 - p be the probability of failure.
The relationship between probabilities dictates:
When conducting n independent Bernoulli trials, the probability of achieving exactly k successes is given by the formula:
where C(n, k) represents the binomial coefficient, the number of ways to choose k successes from n trials.
Bernoulli Trials: Example and Calculation
Probability Calculation
Consider the probability of obtaining two successes in five Bernoulli trials.
Let’s denote:
Successful outcomes: S
Failing outcomes: F
Example sequence: SSFFF
Probability calculation for this specific sequence:
Another possible sequence: FSFSF with the same logic leads to the same probability which is .
Total number of possible sequences with k successes in n trials is determined by the binomial coefficient C(n, k).
Example of a Coin Toss
For a biased coin where the probability of heads (success) is 2/3, let's calculate the probability of exactly four heads in seven tosses.
Total ways to get four heads among seven tosses is given by the binomial coefficient:
The probability of each combination is:
Therefore, the total probability is given by the product:
Random Variables
Definition
A random variable is defined as a function that maps outcomes from the sample space of an experiment to real numbers.
It quantifies the outcomes for mathematical analysis.
Distribution of Random Variables
Definition: The distribution of a random variable X over sample space S consists of pairs denoted as where P(X = r) signifies the probability that X takes the value r.
Example of a Random Variable
Illustrative example: Flipping a coin three times, let X(s) represent the number of heads.
Outcomes defined:
X(HHH) = 3,
X(TTT) = 0,
X(HHT) = X(HTH) = X(THH) = 2,
X(TTH) = X(THT) = X(HTT) = 1.
Expected Values
Definition
The expected value of a random variable is a statistical measure that provides a weighted average of the possible outcomes when an experiment is repeated many times.
Each outcome contributes to the average based on its probability.
Calculation of Expected Values
For a random variable with outcomes 1 and 2, where 1 occurs with P = 0.1 and 2 occurs with P = 0.9, the traditional arithmetic average is not sufficient as it neglects the probabilities.
True average value is computed as a weighted sum:
The generalized formula for the expected value is:
Examples of Expected Values
Example I: Coin Flips
Flipping a fair coin three times:
Sample space S contains 8 outcomes. The expected value of the random variable X, which counts how many heads appear, is calculated as:
After computation:
Example II: Fair Die
Random variable X defines the outcome on a fair die. Each face shows values 1-6 with equal probabilities of .
Expected value calculated as:
Example III: Sum of Dice
Random variable X denotes the sum of numbers when rolling two dice. The sample size yields 36 outcomes.
Distribution analysis shows that while outcomes are equally likely, the values of X do not share equal probabilities.
Probabilities of outcomes for specific X values:
Expected value is calculated as:
Interpretation: Averaging repeated rolls yields an average sum of 7.
Theorem Relating to Expected Values
Theorem:
If X and Y are random variables on a sample space S, and a and b are real constants:
Following this theorem, the expected value of a sum of two dice can be simplified using their individual expected values:
For two independent random variables X₁ and X₂ representing two dice, we find that:
Thus,
Summary of Key Topics
Discussed concepts include:
Discrete Probability
Conditional Probability
Bernoulli Trials
Random Variables
Expected Values
End of Notes