π Lecture 35 β Probability
π Overview: This lecture introduces the fundamental concepts of probability theory, beginning with its historical origins in gambling analysis. It defines key terms like experiment, sample space, and event, and explains how to calculate probabilities for equally likely outcomes. The lecture provides numerous examples involving dice, cards, lotteries, and defective items, and concludes with the concept of complementary events.
ποΈ Topics Covered
The lecture covers the introduction to probability theory and its historical development, definitions of experiment, sample space, and event with examples using dice. It then presents the formal definition of probability for equally likely outcomes, followed by numerous worked examples including drawing balls from urns, card problems, lottery probabilities, and poker hands. The final section introduces the complement of an event and the theorem P(EαΆ) = 1 β P(E), with applications to defective items problems.
π Lecture Summary
INTRODUCTION TO PROBABILITY
Combinatorics and probability theory share common origins. The theory of probability was first developed in the seventeenth century when certain gambling games were analyzed by the French mathematician Blaise Pascal. It was in these studies that Pascal discovered various properties of the binomial coefficients. In the eighteenth century, the French mathematician Laplace, who also studied gambling, gave the definition of probability as the number of successful outcomes divided by the number of total outcomes.
DEFINITIONS
An experiment is a procedure that yields a given set of possible outcomes. The sample space of the experiment is the set of possible outcomes. An event is a subset of the sample space.
π Definition β Experiment: a procedure that yields a given set of possible outcomes. π Definition β Sample Space: the set of all possible outcomes of an experiment. π Definition β Event: a subset of the sample space.
π Example: When a die is tossed, the sample space S = {1, 2, 3, 4, 5, 6}. Let Eβ be the event that a 6 occurs, Eβ be the event that an even number occurs, Eβ be the event that an odd number occurs, Eβ be the event that a prime number occurs, Eβ be the event that a number less than 5 occurs, and Eβ be the event that a number greater than 6 occurs. Then Eβ = {6}, Eβ = {2, 4, 6}, Eβ = {1, 3, 5}, Eβ = {2, 3, 5}, Eβ = {1, 2, 3, 4}, Eβ = Π€.
π Example: When a pair of dice is tossed, the sample space S has 36 outcomes: S = {(1,1), (1,2), ... , (6,6)}. Let E be the event in which the sum of the numbers is ten. Then E = {(4,6), (5,5), (6,4)}.
DEFINITION OF PROBABILITY
Let S be a finite sample space such that all the outcomes are equally likely to occur. The probability of an event E, which is a subset of sample space S, is:
π Formula: P(E) = number of outcomes in E / number of total outcomes in S = n(E) / n(S)
Since Ο β E β S, therefore 0 β€ n(E) β€ n(S). It follows that the probability of an event is always between 0 and 1.
π‘ Why this matters: Since n(Ο) = 0 and n(S) = 1, the probability of any event is always between 0 and 1, inclusive.
π Example: What is the probability of getting a number greater than 4 when a die is tossed? Solution: Sample space S = {1,2,3,4,5,6}. Let E be the event that a number greater than 4 occurs. Then E = {5,6}. Hence, P(E) = n(E)/n(S) = 2/6 = 1/3.
π Example: What is the probability of getting a total of eight or nine when a pair of dice is tossed? Solution: When a pair of dice is tossed, sample space S has 36 outcomes. Let E be the event that the sum is eight or nine. Then E = {(2,6), (3,5), (4,4), (5,3), (6,2), (3,6), (4,5), (5,4), (6,3)}. Hence, P(E) = n(E)/n(S) = 9/36 = 1/4.
π Example: An urn contains four red and five blue balls. What is the probability that a ball chosen from the urn is blue? Solution: Total number of possible outcomes = 4 + 5 = 9. The total number of favorable outcomes for blue = 5. The probability that a ball chosen is blue = 5/9.
π Example: Two cards are drawn at random from an ordinary pack of 52 cards. Find the probability p that (i) both are spades, (ii) one is a spade and one is a heart. Solution: There are C(52,2) = 1326 ways to draw 2 cards from 52 cards. (i) There are C(13,2) = 78 ways to draw 2 spades from 13 spades; hence p = 78/1326 = 1/17. (ii) Since there are 13 spades and 13 hearts, there are C(13,1) Γ C(13,1) = 13 Γ 13 = 169 ways to draw a spade and a heart; hence p = 169/1326 = 13/102.
π Example: In a lottery, players win the first prize when they pick three digits that match, in the correct order, three digits kept secret. A second prize is won if only two digits match. What is the probability of winning (a) the first prize, (b) the second prize? Solution: Using the product rule, there are 10Β³ = 1000 ways to choose three digits. (a) There is only one way to choose all three digits correctly. Hence the probability that a player wins the first prize is 1/1000 = 0.001. (b) There are three possible cases: (i) The first digit is incorrect and the other two digits are correct, (ii) The second digit is incorrect and the other two digits are correct, (iii) The third digit is incorrect and the other digits are correct. For the first digit incorrect, there are nine choices for the first digit to be incorrect, and one each for the other two digits to be correct. Hence, there are nine ways for each case. So there are 9 + 9 + 9 = 27 ways to choose three digits with two of the three digits correct. The probability that a player wins the second prize is 27/1000 = 0.027.
π Example: What is the probability that a hand of five cards contains four cards of one kind? Solution: (i) The number of ways to pick one kind = C(13,1). The number of ways to pick the four of this kind out of the four of this kind in the deck = C(4,4). The number of ways to pick the fifth card from the remaining 48 cards = C(48,1). Hence, the number of hands of five cards with four cards of one kind = C(13,1) Γ C(4,4) Γ C(48,1) = 13 Γ 1 Γ 48 = 624. (ii) The total number of different hands of five cards = C(52,5) = 2,598,960. Probability = 624/2,598,960 β 0.0024.
π Example: Find the probability that a hand of five cards contains three cards of one kind and two of another kind. Solution: (i) The number of ways to pick two kinds = C(13,2). The number of ways to pick three out of four of the first kind = C(4,3). The number of ways to pick two out of four of the second kind = C(4,2). Hence, the number of hands with three cards of one kind and two of another kind = C(13,2) Γ C(4,3) Γ C(4,2). (ii) The total number of different hands of five cards = C(52,5) = 2,598,960. Probability = 3744/2,598,960 β 0.0014.
π Example: What is the probability that a randomly chosen positive two-digit number is a multiple of 6? Solution: 1. There are β99/6β = 16 positive integers from 1 to 99 that are divisible by 6. Out of these, 16 β 1 = 15 are two-digit numbers (as 6 is a multiple of 6 but not a two-digit number). 2. There are 99 β 9 = 90 positive two-digit numbers in all. Hence, the probability = 15/90 = 1/6 β 0.166667.
COMPLEMENT OF AN EVENT
Let E be an event in a sample space S, the complement of E is the event that occurs if E does not occur. It is denoted by EαΆ. Note that EαΆ = S\E.
π Definition β Complement of an event E: the event that occurs if E does not occur, denoted EαΆ = S\E.
π Example: Let E be the event that an even number occurs when a die is tossed. Then EαΆ is the event that an odd number occurs.
THEOREM: Let E be an event in a sample space S. The probability of the complementary event EαΆ of E is given by:
π Formula: P(EαΆ) = 1 β P(E)
π Example: Let 2 items be chosen at random from a lot containing 12 items of which 4 are defective. What is the probability that (i) none of the items chosen are defective, (ii) at least one item is defective? Solution: The number of ways 2 items can be chosen from 12 items = C(12,2) = 66. (i) Let A be the event that none of the items chosen are defective. The number of favorable outcomes for A = the number of ways 2 items can be chosen from 8 non-defective items = C(8,2) = 28. Hence, P(A) = 28/66 = 14/33. (ii) Let B be the event that at least one item chosen is defective. Then clearly B = AαΆ. It follows that P(B) = P(AαΆ) = 1 β P(A) = 1 β 14/33 = 19/33.
π Example: Three light bulbs are chosen at random from 15 bulbs of which 5 are defective. Find the probability p that (i) none is defective, (ii) exactly one is defective, (iii) at least one is defective. Solution: There are C(15,3) = 455 ways to choose 3 bulbs from the 15 bulbs. (i) Since there are 15 β 5 = 10 non-defective bulbs, there are C(10,3) = 120 ways to choose 3 non-defective bulbs. Thus p = 120/455 = 24/91. (ii) There are 5 defective bulbs and C(10,2) = 45 different pairs of non-defective bulbs; hence there are C(5,1) Γ C(10,2) = 5 Γ 45 = 225 ways to choose 3 bulbs of which one is defective. Thus p = 225/455 = 45/91. (iii) The event that at least one is defective is the complement of the event that none are defective which has probability 24/91. Hence p(at least one is defective) = 1 β 24/91 = 67/91.
β Key Takeaways
The probability of an event is the ratio of favorable outcomes to total equally likely outcomes, always between 0 and 1. The sample space is the set of all possible outcomes, and events are subsets of the sample space. Combinatorics (combinations and the product rule) is essential for counting favorable and total outcomes in probability problems. The complement of an event E (EαΆ) represents the event that E does not occur, and its probability is 1 β P(E), which is particularly useful for "at least one" problems. Understanding how to identify equally likely outcomes and apply the basic probability formula P(E) = n(E)/n(S) is fundamental to solving all probability problems in this lecture.
π§ Quick Revision Questions
- What is the sample space when a single die is tossed, and what is the probability of rolling a number greater than 4?
- Two cards are drawn from a standard 52-card deck. What is the probability that both are spades?
- In a three-digit lottery where digits are chosen in correct order, what is the probability of winning the first prize? The second prize (exactly two digits match)?
- What is the formula for the probability of the complement of an event E, and how would you use it to find the probability of drawing at least one defective item from a batch?
- A hand of five cards is drawn from a standard deck. What is the probability that the hand contains four cards of one kind (e.g., four aces)?
π Lecture 36 β Laws of Probability VU
π Overview: This lecture covers the fundamental addition laws of probability, focusing on both the simple addition law for mutually exclusive events and the general addition law for non-disjoint events. It provides extensive examples and exercises to demonstrate these concepts, including applications to dice rolls, card draws, and survey data.
ποΈ Topics Covered
The lecture covers the addition law for disjoint (mutually exclusive) events with its proof and examples, the general addition law for any two events with proof and multiple exercises, the probability of sub-events theorem, and the extension of the addition law to three events. Key applications include problems involving balls in bags, dice throws, card draws, class demographics, integer divisibility, and class attendance.
π Lecture Summary
ADDITION LAW OF PROBABILITY
THEOREM: If A and B are two disjoint (mutually exclusive) events of a sample space S, then P(A βͺ B) = P(A) + P(B). In words, the probability of the happening of an event A or an event B or both is equal to the sum of the probabilities of event A and event B provided the events have nothing in common.
PROOF: By the inclusion-exclusion principle for mutually disjoint sets, n(A βͺ B) = n(A) + n(B). Dividing both sides by n(S), we get n(A βͺ B)/n(S) = n(A)/n(S) + n(B)/n(S) β P(A βͺ B) = P(A) + P(B).
π Definition β Disjoint (Mutually Exclusive) Events: Events that have no outcomes in common; they cannot occur simultaneously.
π Example: Suppose a die is rolled. Let A be the event that 1 appears and B be the event that some even number appears on the die. Then S = {1, 2, 3, 4, 5, 6}, A = {1} and B = {2, 4, 6}. Clearly A and B are disjoint events and P(A) = 1/6, P(B) = 3/6. Hence the probability that a 1 appears or some even number appears is P(A βͺ B) = 1/6 + 3/6 = 4/6 = 2/3.
π Example (Exercise): A bag contains 6 white, 5 black and 4 red balls. Find the probability of getting a white or a black ball in a single draw. Total balls = 6 + 5 + 4 = 15. Let A be getting a white and B be getting a black ball. Events are disjoint. P(A) = 6/15, P(B) = 5/15. P(A βͺ B) = 6/15 + 5/15 = 11/15.
π Example (Exercise): A pair of dice is thrown. Find the probability of getting a total of 5 or 11. Sample space has 36 outcomes. Let A be a total of 5: A = {(1,4), (2,3), (3,2), (4,1)} and B be a total of 11: B = {(5,6), (6,5)}. Events are disjoint. P(A βͺ B) = 4/36 + 2/36 = 6/36 = 1/6.
π Example (Exercise): For any two events A and B of a sample space S, prove that P(A\B) = P(A β© B') = P(A) - P(A β© B). Proof: The event A can be written as the union of two disjoint events A\B and A β© B. i.e., A = (A\B) βͺ (A β© B). Hence, by addition law of probability: P(A) = P(A\B) + P(A β© B) β P(A\B) = P(A) - P(A β© B).
π Definition β Event A\B (A minus B): The event that A occurs but B does not occur, also written as A β© B'.
GENERAL ADDITION LAW OF PROBABILITY
THEOREM: If A and B are any two events of a sample space S, then P(A βͺ B) = P(A) + P(B) - P(A β© B).
PROOF: The event A βͺ B may be written as the union of two disjoint events A\B and B. i.e., A βͺ B = (A\B) βͺ B. Hence, by addition law of probability (for disjoint events): P(A βͺ B) = P(A\B) + P(B) = [P(A) - P(A β© B)] + P(B) = P(A) + P(B) - P(A β© B). (proved)
REMARK: By inclusion-exclusion principle: n(A βͺ B) = n(A) + n(B) - n(A β© B). Dividing both sides by n(S) and denoting the ratios as respective probabilities gives the generalized addition law.
π Example (Exercise): Let A and B be events in a sample space S, with P(A) = 0.65, P(B) = 0.30 and P(A β© B) = 0.15. Determine: (a) P(A β© B') = P(A) - P(A β© B) = 0.65 - 0.15 = 0.50 (b) P(A βͺ B) = P(A) + P(B) - P(A β© B) = 0.65 + 0.30 - 0.15 = 0.80 (c) P(A' β© B') = P((A βͺ B)') = 1 - P(A βͺ B) = 1 - 0.80 = 0.20
π Example (Exercise): Let A, B, C and D be events which form a partition of a sample space S. If P(A) = P(B), P(C) = 2P(A) and P(D) = 2P(C). Determine each of the following probabilities. (a) P(A): Since they form a partition, S = A βͺ B βͺ C βͺ D and are pairwise disjoint. 1 = P(A) + P(A) + 2P(A) + 2(2P(A)) = 8P(A) β P(A) = 1/8 (b) P(A βͺ B) = P(A) + P(B) = 1/8 + 1/8 = 1/4 (c) P(A βͺ C βͺ D) = P(A) + P(C) + P(D) = 1/8 + 2(1/8) + 2(2/8) = 1/8 + 2/8 + 4/8 = 7/8
π Definition β Partition of a Sample Space: A collection of events that are pairwise disjoint (mutually exclusive) and whose union equals the entire sample space.
π Example (Exercise): A card is drawn from a well-shuffled pack of playing cards. What is the probability that it is either a spade or an ace? Let A be drawing a spade and B be drawing an ace. A and B are not disjoint. A β© B is the ace of spades. P(A) = 13/52, P(B) = 4/52, P(A β© B) = 1/52. P(A βͺ B) = 13/52 + 4/52 - 1/52 = 16/52 = 4/13.
π Example (Exercise): A class contains 10 boys and 20 girls of which half the boys and half the girls have brown eyes. Find the probability that a student chosen at random is a boy or has brown eyes. Let A be that a boy is chosen and B be that a student with brown eyes is chosen. P(A) = 10/30, P(B) = (5+10)/30 = 15/30, P(Aβ©B) = 5/30. P(AβͺB) = 10/30 + 15/30 - 5/30 = 20/30 = 2/3.
π Example (Exercise): An integer is chosen at random from the first 100 positive integers. What is the probability that the integer chosen is divisible by 6 or by 8? Let A be divisible by 6 and B be divisible by 8. Aβ©B is divisible by LCM(6,8)=24. n(A) = floor(100/6) = 16, n(B) = floor(100/8) = 12, n(Aβ©B) = floor(100/24) = 4. P(AβͺB) = 16/100 + 12/100 - 4/100 = 24/100 = 6/25.
π Example (Exercise): A student attends mathematics class with probability 0.7, skips accounting class with probability 0.4, and attends both with probability 0.5. Find: (1) P(attends at least one class) and (2) P(attends exactly one class). (1) P(A) = 0.7, P(B) = 1 - 0.4 = 0.6, P(Aβ©B) = 0.5. P(AβͺB) = 0.7 + 0.6 - 0.5 = 0.8. (2) P(exactly one) = P(Aβ©B') + P(A'β©B) = [0.7-0.5] + [0.6-0.5] = 0.2 + 0.1 = 0.3.
PROBABILITY OF SUB EVENT
THEOREM: If A and B are two events such that A β B, then P(A) β€ P(B).
PROOF: Suppose A β B. The event B may be written as the union of disjoint events Bβ©A and Bβ©A'. But Bβ©A = A (as A β B). So B = A βͺ (Bβ©A'). β΄ P(B) = P(A) + P(Bβ©A'). Since P(Bβ©A') β₯ 0, P(B) β₯ P(A) or P(A) β€ P(B).
π Example (Exercise): Let A and B be subsets of a sample space S with P(A) = 0.7 and P(B) = 0.5. What are the maximum and minimum possible values of P(AβͺB)? By addition law: P(AβͺB) = 0.7 + 0.5 - P(Aβ©B) = 1.2 - P(Aβ©B). Max P(AβͺB) = 1, for which P(Aβ©B) = 0.2. Since Aβ©B β B, P(Aβ©B) β€ P(B) = 0.5. For min P(AβͺB), take max P(Aβ©B) = 0.5. Hence min P(AβͺB) = 1.2 - 0.5 = 0.7.
ADDITION LAW OF PROBABILITY FOR THREE EVENTS
If A, B and C are any three events, then P(A βͺ B βͺ C) = P(A) + P(B) + P(C) - P(Aβ©B) - P(Aβ©C) - P(Bβ©C) + P(Aβ©Bβ©C).
REMARK: If A, B, C are mutually disjoint events, then P(A βͺ B βͺ C) = P(A) + P(B) + P(C).
π Example (Exercise): Three newspapers A, B, C are published in a city. Survey: 20% read A, 16% read B, 14% read C, 8% read both A and B, 5% read both A and C, 4% read both B and C, 2% read all three. Find probability that a person reads none of the papers. P(A) = 0.2, P(B) = 0.16, P(C) = 0.14, P(Aβ©B) = 0.08, P(Aβ©C) = 0.05, P(Bβ©C) = 0.04, P(Aβ©Bβ©C) = 0.02. P(AβͺBβͺC) = 0.2 + 0.16 + 0.14 - 0.08 - 0.05 - 0.04 + 0.02 = 0.35 P(reads none) = 1 - P(AβͺBβͺC) = 1 - 0.35 = 0.65 = 65%
π Example (Exercise): Let A, B and C be events in sample space S, with AβͺBβͺC = S, Aβ©(BβͺC) = β , P(A) = 0.2, P(B) = 0.5, P(C) = 0.7. Find P(A^C), P(BβͺC), P(Bβ©C). P(A^C) = 1 - 0.2 = 0.8. Since A and BβͺC are disjoint, P(Aβͺ(BβͺC)) = P(A) + P(BβͺC). But AβͺBβͺC = S, so 1 = 0.2 + P(BβͺC) β P(BβͺC) = 0.8. By addition law: 0.8 = 0.5 + 0.7 - P(Bβ©C) β P(Bβ©C) = 0.4.
π‘ Why this matters: The addition laws are foundational for calculating probabilities of combined events, which is essential for risk assessment, decision-making, and data analysis in fields such as finance, insurance, and scientific research.
β Key Takeaways
The addition law for disjoint events states P(AβͺB) = P(A) + P(B), while the general addition law for any two events states P(AβͺB) = P(A) + P(B) - P(Aβ©B). The subtraction of P(Aβ©B) in the general law corrects for double-counting when events overlap. For three events, the formula extends to include all pairwise intersections and adds back the triple intersection. The sub-event theorem shows that if A β B, then P(A) β€ P(B). Understanding when events are mutually exclusive versus non-exclusive is critical for applying the correct formula.
π§ Quick Revision Questions
- State the addition law for disjoint events and give a simple example.
- What is the general addition law for any two events, and why must P(Aβ©B) be subtracted?
- If P(A) = 0.6, P(B) = 0.4, and P(Aβ©B) = 0.2, what is P(AβͺB)?
- Prove that if A β B, then P(A) β€ P(B).
- Write out the addition law for three events A, B, and C.
π Lecture 37 β Conditional Probability
π Overview: This lecture introduces the fundamental concept of conditional probability, which measures the probability of an event occurring given that another event has already occurred. It covers the multiplication theorem for computing joint probabilities and the concept of independent events, which are essential for understanding relationships between events in probability theory.
ποΈ Topics Covered
The lecture covers conditional probability definition and formula, the multiplication theorem for two and multiple events, and the concept of independent events. Examples include dice tossing, ball selection from urns, family with two children, defective items inspection, bit strings, and target shooting problems. Exercises demonstrate calculations of conditional probabilities including complements and mutually exclusive events.
π Lecture Summary
CONDITIONAL PROBABILITY
Conditional probability measures the likelihood of an event occurring given that another event has already occurred. When additional information becomes available, the sample space is reduced to only those outcomes that satisfy the given condition.
π Definition β Conditional Probability: Let E and F be two events in the sample space of an experiment with P(F) β 0. The conditional probability of E given F, denoted by P(E|F), is defined as:
π Formula: P(E|F) = P(E β© F) / P(F) β The probability that E occurs, knowing that F has already occurred, equals the probability that both occur divided by the probability of the given event F.
π Example: When a die is tossed, the probability of getting a 2 is 1/6. If we know an even number appears (2,4,6), the probability that the number is 2 becomes 1/3, since only one of three even numbers is 2.
π Example: An urn contains 3 red, 2 blue, and 4 white balls. P(red) = 3/9. If we know the selected ball is not white (so only 5 balls: 3 red + 2 blue), then P(red|not white) = 3/5.
π Example: Let P(B) = 1/4 and P(Aβ©B) = 1/6. Then P(A|B) = (1/6)/(1/4) = 4/6 = 2/3.
π Example: Let P(A) = 1/2, P(B) = 1/3, P(Aβ©B) = 1/4. Then:
- P(A|B) = (1/4)/(1/3) = 3/4
- P(B|A) = (1/4)/(1/2) = 1/2
- P(AβͺB) = 1/2 + 1/3 - 1/4 = 7/12
- P(A^c|B^c) = P(A^c β© B^c)/P(B^c) = [1 - P(AβͺB)]/[1 - P(B)] = (1 - 7/12)/(1 - 1/3) = (5/12)/(2/3) = 5/8
π Example: Find P(B|A) if A is a subset of B. When A β B, then B β© A = A, so P(B|A) = P(A)/P(A) = 1.
π Example: Find P(B|A) if A and B are mutually exclusive. When A and B are mutually exclusive, B β© A = β , so P(B|A) = 0/P(A) = 0.
π Example: An urn contains 3 red balls (marked 1,2,3), 1 blue ball (marked 4), and 4 white balls (marked 5,6,7,8). Total = 8 balls.
- P(red) = 3/8
- P(even number) = 4/8 (numbers 2,4,6,8)
- P(red|even) = P(red β© even)/P(even) = (1/8)/(4/8) = 1/4 (only ball 2 is red and even)
- P(even|red) = P(red β© even)/P(red) = (1/8)/(3/8) = 1/3
π Example: A pair of dice is tossed. If the sum is 7, find the probability that one of the dice is 2. Let E = {at least one 2 appears}, F = {sum is 7} = {(1,6),(2,5),(3,4),(4,3),(5,2),(6,1)}. Eβ©F = {(2,5),(5,2)}. P(F) = 6/36, P(Eβ©F) = 2/36. P(E|F) = (2/36)/(6/36) = 1/3.
π‘ Why this matters: Conditional probability allows us to update probabilities when new information becomes available. The key insight is that the denominator is always the probability of the condition event.
π Example: A family has two children. One child, a boy, comes into the room. Sample space: S = {bb, bg, gb, gg} where first letter is younger, second is elder.
- (i) If the other child is known to be elder (so younger is the boy we saw): Let A = {both boys} = {bb}, B = {younger is a boy} = {bb, bg}. P(A|B) = (1/4)/(2/4) = 1/2.
- (ii) If nothing is known about the other child: Let C = {one child is a boy} = {bb, bg, gb}. P(A|C) = (1/4)/(3/4) = 1/3.
MULTIPLICATION THEOREM
The multiplication theorem provides a formula for computing the probability of the intersection of two or more events using conditional probabilities.
π Definition β Multiplication Theorem: Let E and F be two events. Then P(Eβ©F) = P(F)P(E|F) or P(Eβ©F) = P(E)P(F|E).
For n events Eβ, Eβ, ..., Eβ: P(Eββ©Eββ©...β©Eβ) = P(Eβ)P(Eβ|Eβ)P(Eβ|Eββ©Eβ)...P(Eβ|Eββ©Eββ©...β©Eβββ)
π Example: A lot contains 12 items, 4 are defective. Three items are drawn at random one after another. Find P(all three are non-defective). Let Aβ = {first non-defective}, Aβ = {second non-defective}, Aβ = {third non-defective}. P(Aβ) = 8/12, P(Aβ|Aβ) = 7/11, P(Aβ|Aββ©Aβ) = 6/10. P(Aββ©Aββ©Aβ) = (8/12)(7/11)(6/10) = 336/1320 = 14/55.
INDEPENDENCE
Two events are independent if the occurrence of one does not affect the probability of the other.
π Definition β Independent Events: An event A is said to be independent of event B if P(A|B) = P(A). Equivalently, A and B are independent if and only if P(Aβ©B) = P(A)P(B).
If A and B are independent, then P(B|A) = P(Aβ©B)/P(A) = P(A)P(B)/P(A) = P(B).
π Example: Random bit string of length 4. A = {begins with 1}, B = {contains an even number of 0s}. P(A) = 8/16 = 1/2, P(B) = 8/16 = 1/2. Aβ©B = {1001, 1010, 1100, 1111}, P(Aβ©B) = 4/16 = 1/4. Since P(Aβ©B) = 1/4 = (1/2)(1/2) = P(A)P(B), A and B are independent.
π Example: A fair coin tossed three times. A = {first toss heads}, B = {second toss heads}, C = {exactly two heads in a row}. S = {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT} A = {HHH, HHT, HTH, HTT}, P(A) = 1/2 B = {HHH, HHT, THH, THT}, P(B) = 1/2 C = {HHT, THH}, P(C) = 1/4 Aβ©B = {HHH, HHT}, P(Aβ©B) = 2/8 = 1/4 = P(A)P(B) β A and B are independent Aβ©C = {HHT}, P(Aβ©C) = 1/8 = P(A)P(C) β A and C are independent Bβ©C = {HHT, THH}, P(Bβ©C) = 2/8 = 1/4 β P(B)P(C) = 1/8 β B and C are dependent
π Example: P(A hits target) = 1/3, P(B hits target) = 2/5. They shoot independently. P(target is hit) = P(AβͺB) = P(A) + P(B) - P(Aβ©B) = P(A) + P(B) - P(A)P(B) (due to independence) = 1/3 + 2/5 - (1/3)(2/5) = 1/3 + 2/5 - 2/15 = 5/15 + 6/15 - 2/15 = 9/15 = 3/5.
β Key Takeaways
Conditional probability P(E|F) = P(Eβ©F)/P(F) fundamentally changes the sample space to only outcomes satisfying condition F. The multiplication theorem P(Eβ©F) = P(F)P(E|F) allows computation of joint probabilities from conditional ones. Two events are independent if and only if P(Aβ©B) = P(A)P(B), which is equivalent to P(A|B) = P(A). Independence does not mean mutually exclusive β in fact, mutually exclusive events with positive probabilities are always dependent (P(Aβ©B)=0 while P(A)P(B)>0). Pairwise independence does not guarantee mutual independence among three or more events.
π§ Quick Revision Questions
- What is the formula for conditional probability P(E|F) and why must P(F) β 0?
- If A β B, what is P(B|A) and why?
- A lot has 10 items with 3 defective. Three items are drawn without replacement. What is the probability all three are defective? (Use multiplication theorem.)
- How can you determine whether two events A and B are independent? State both equivalent conditions.
- If P(A) = 0.4, P(B) = 0.5, and P(Aβ©B) = 0.2, are A and B independent? Calculate P(A|B) and P(B|A) to verify.
π Lecture 38 β Random Variable
π Overview: This lecture introduces the concept of a random variable as a function that assigns numerical values to outcomes of a random experiment. It covers how to construct probability distributions, compute expectations (means), and calculate variance and standard deviation to measure dispersion. Understanding random variables is fundamental to probability and statistics, as they form the basis for modeling real-world uncertainties.
ποΈ Topics Covered
The lecture covers the definition of a random variable with examples (tossing dice, sampling defective items), the construction of probability distribution functions from sample spaces, the computation of expectation (mean) of a random variable with multiple worked examples (coin tossing, weighted coins), and finally the calculation of variance and standard deviation as measures of spread, including a detailed example involving the maximum of two dice.
π Lecture Summary
RANDOM VARIABLE
A random variable X is a rule that assigns a numerical value to each outcome in a sample space S. It is a function which maps each outcome of the sample space into the set of real numbers. We let X(S) denote the set of numbers assigned, referred to as the range space.
π Definition β Random Variable: A function from the sample space S to the set of real numbers R, where X(S) is the range of X.
Remark: A random variable is also called a chance variable or a stochastic variable (not simply a variable, because it is a function). Random variables are usually denoted by capital letters such as X, Y, Z; values taken are represented by corresponding small letters.
π Example: A pair of fair dice is tossed. Sample space S consists of 36 ordered pairs.
- Let X assign to each point the sum of the numbers: X(S) = {2,3,4,5,6,7,8,9,10,11,12}
- Let Y assign the maximum of the two numbers: Y(S) = {1,2,3,4,5,6}
PROBABILITY DISTRIBUTION OF A RANDOM VARIABLE
Let X(S) = {xβ, xβ, ..., xβ} be the range space of a random variable X. Define a function f on X(S) as: f(xα΅’) = P(X = xα΅’) = sum of probabilities of points in S whose image is xα΅’. This function f is called the probability distribution or the probability function of X.
π Definition β Probability Distribution: A function f that assigns to each value xα΅’ the probability P(X = xα΅’), satisfying: (i) f(xα΅’) β₯ 0 and (ii) Ξ£ f(xα΅’) = 1 for i = 1 to n.
π Example: A pair of fair dice is tossed. Let X assign the sum of numbers. Distribution of X:
- f(2) = P(X=2) = 1/36
- f(3) = P(X=3) = 2/36
- f(4) = P(X=4) = 3/36
- f(5) = P(X=5) = 4/36
- f(6) = P(X=6) = 5/36
- f(7) = P(X=7) = 6/36
- f(8) = P(X=8) = 5/36
- f(9) = P(X=9) = 4/36
- f(10) = P(X=10) = 3/36
- f(11) = P(X=11) = 2/36
- f(12) = P(X=12) = 1/36
π Example: A box contains 12 items, 3 defective. Sample of 3 items selected. X = number of defective items in sample. Total samples = C(12,3) = 220.
- P(X=0) = [C(3,0)ΓC(9,3)]/220 = 84/220
- P(X=1) = [C(3,1)ΓC(9,2)]/220 = 108/220
- P(X=2) = [C(3,2)ΓC(9,1)]/220 = 27/220
- P(X=3) = [C(3,3)ΓC(9,0)]/220 = 1/220
EXPECTATION OF A RANDOM VARIABLE
The mean (ΞΌ) or expectation of X [written E(X)] is defined by: ΞΌ = E(X) = xβf(xβ) + xβf(xβ) + ... + xβf(xβ) = Ξ£ xα΅’ f(xα΅’) for i = 1 to n.
π Formula: E(X) = Ξ£ xα΅’ f(xα΅’) β Sum of each value multiplied by its probability.
π Example: Expectation of number of heads when three fair coins are tossed. Sample space: S = {TTT, TTH, THT, HTT, THH, HTH, HHT, HHH} Distribution: x = {0,1,2,3} with probabilities {1/8, 3/8, 3/8, 1/8} E(X) = 0(1/8) + 1(3/8) + 2(3/8) + 3(1/8) = 12/8 = 1.5
π Example: A player tosses two fair coins. Wins Rs.1 if one head, Rs.2 if two heads, loses Rs.5 if no heads. Expected value of game? P(Two heads) = 1/4, P(One head) = 1/2, P(No heads) = 1/4 E = 2(1/4) + 1(1/2) + (-5)(1/4) = 0.5 + 0.5 - 1.25 = -0.25 Since expected value is negative, the game is unfavorable to the player.
π Example: Weighted coin with P(H)=3/4, P(T)=1/4 tossed three times. X = number of heads. Distribution: P(0)=1/64, P(1)=9/64, P(2)=27/64, P(3)=27/64 E(X) = 0(1/64) + 1(9/64) + 2(27/64) + 3(27/64) = 144/64 = 2.25
VARIANCE AND STANDARD DEVIATION OF A RANDOM VARIABLE
The variance of X measures the "spread" or "dispersion" of X from the mean ΞΌ.
π Definition β Variance: Var(X) = ΟΒ² = Ξ£ (xα΅’ - ΞΌ)Β² f(xα΅’) for i = 1 to n = E((X - ΞΌ)Β²) = E(XΒ²) - ΞΌΒ²
The standard deviation of X, denoted Οβ, is the non-negative square root of Var(X): Οβ = βVar(X)
π Formula: ΟΒ² = E(XΒ²) - ΞΌΒ² (convenient form for computation)
π Example: Find ΞΌ, ΟΒ², and Ο for distribution: xα΅’: 1, 3, 4, 5 with f(xα΅’): 0.4, 0.1, 0.2, 0.3 ΞΌ = E(X) = 1(0.4) + 3(0.1) + 4(0.2) + 5(0.3) = 0.4 + 0.3 + 0.8 + 1.5 = 3.0 E(XΒ²) = 1Β²(0.4) + 3Β²(0.1) + 4Β²(0.2) + 5Β²(0.3) = 0.4 + 0.9 + 3.2 + 7.5 = 12.0 ΟΒ² = 12.0 - (3.0)Β² = 3.0 Ο = β3.0 β 1.7
π Example: Pair of fair dice thrown. X = maximum of two numbers. Distribution: f(1)=1/36, f(2)=3/36, f(3)=5/36, f(4)=7/36, f(5)=9/36, f(6)=11/36 ΞΌ = 1(1/36) + 2(3/36) + 3(5/36) + 4(7/36) + 5(9/36) + 6(11/36) = 161/36 β 4.5 E(XΒ²) = 1Β²(1/36) + 2Β²(3/36) + 3Β²(5/36) + 4Β²(7/36) + 5Β²(9/36) + 6Β²(11/36) = 791/36 β 22.0 ΟΒ² = 22.0 - (4.5)Β² = 17.5 Οβ = β17.5 β 1.3
π‘ Why this matters: Variance and standard deviation quantify how much a random variable's values deviate from the mean, which is crucial for risk assessment, quality control, and understanding uncertainty in predictions.
β Key Takeaways
A random variable is a function that assigns numerical values to sample space outcomes, not just a simple variable. Its probability distribution satisfies non-negativity and sums to one. The expectation E(X) = Ξ£ xα΅’ f(xα΅’) represents the weighted average or long-run average value. Variance ΟΒ² = E(XΒ²) - ΞΌΒ² measures dispersion around the mean, while standard deviation Ο = βΟΒ² provides the same measure in original units. These concepts are essential for analyzing and interpreting probabilistic systems.
π§ Quick Revision Questions
- What is a random variable and how is it different from an ordinary variable?
- What two conditions must a probability distribution f(xα΅’) always satisfy?
- How do you compute the expectation E(X) from a probability distribution table?
- What is the formula for variance in terms of E(XΒ²) and the mean ΞΌ?
- In the dice example, why does f(7) have the highest probability (6/36) among all sums?
π Lecture 39 β Introduction to Graphs
π Overview: This lecture introduces graph theory, a fundamental mathematical structure used extensively in computer science. It covers basic graph terminology, types of graphs (simple, complete, regular, bipartite), and the Handshaking Theorem, which relates the sum of vertex degrees to the number of edges. Understanding these concepts is crucial for modeling networks, relationships, and structures in computing.
ποΈ Topics Covered
The lecture begins with a formal definition of a graph as vertices and edges, then explains essential terminology like endpoints, loops, adjacent vertices, isolated vertices, and parallel edges. It covers how to draw graphs from given vertex/edge sets and defines a simple graph. The degree of a vertex is introduced, leading to the Handshaking Theorem and its corollary. Finally, special types of graphs are explored: complete graphs (Kβ), regular graphs, bipartite graphs, and complete bipartite graphs (Kβ,β), with the labeling procedure to determine bipartiteness.
π Lecture Summary
INTRODUCTION TO GRAPHS
Graph theory plays an important role in several areas of computer science such as switching theory and logical design, artificial intelligence, formal languages, computer graphics, operating systems, compiler writing, and information organization and retrieval.
A graph is a non-empty set of points called vertices and a set of line segments joining pairs of vertices called edges. Formally, a graph G consists of two finite sets: (i) A set V=V(G) of vertices (or points or nodes) (ii) A set E=E(G) of edges; where each edge corresponds to a pair of vertices.
SOME TERMINOLOGY
- An edge connects either one or two vertices called its endpoints (edge eβ connects vertices vβ and vβ described as {vβ, vβ}).
- An edge with just one endpoint is called a loop. Thus a loop is an edge that connects a vertex to itself.
- Two vertices that are connected by an edge are called adjacent; and a vertex that is an endpoint of a loop is said to be adjacent to itself.
- An edge is said to be incident on each of its endpoints.
- A vertex on which no edges are incident is called isolated.
- Two distinct edges with the same set of end points are said to be parallel.
π Example: For a graph with vertex set {vβ, vβ, vβ, vβ} and edge set {eβ, eβ, eβ}, where eβ connects {vβ, vβ}, eβ connects {vβ, vβ}, and eβ connects {vβ} (a loop), we find: (i) vβ is incident with edges eβ, eβ and eβ; (ii) vertices adjacent to vβ are vβ and vβ; (iii) loops are eβ and eβ; (iv) only edges eβ and eβ are parallel; (v) the only isolated vertex is vβ.
SIMPLE GRAPH
A simple graph is a graph that does not have any loop or parallel edges.
π Example: Draw all simple graphs with the four vertices {u, v, w, x} and two edges, one of which is {u, v}. There are C(4,2) = 6 ways of choosing two vertices from 4 vertices. These edges may be listed as: {u,v}, {u,w}, {u,x}, {v,w}, {v,x}, {w,x}. One edge is specified to be {u,v}, so any of the remaining five may be chosen to be the second edge, resulting in 5 possible graphs.
DEGREE OF A VERTEX
Let G be a graph and v a vertex of G. The degree of v, denoted deg(v), equals the number of edges that are incident on v, with an edge that is a loop counted twice.
π Definition β Degree: The degree of a vertex is the number of edges incident on it, counting loops twice.
Note: (i) The total degree of G is the sum of the degrees of all the vertices of G. (ii) The degree of a loop is counted twice.
π Example: For a graph with vertices vβ (isolated), vβ, and vβ (with a loop): deg(vβ) = 0, deg(vβ) = 2, deg(vβ) = 4. Total degree of G = 0 + 2 + 4 = 6, which equals twice the number of edges (3).
THE HANDSHAKING THEOREM
If G is any graph, then the sum of the degrees of all the vertices of G equals twice the number of edges of G. Specifically, if the vertices of G are vβ, vβ, ..., vβ, then: total degree of G = deg(vβ) + deg(vβ) + ... + deg(vβ) = 2 Β· (the number of edges of G)
π Formula: Ξ£ deg(vα΅’) = 2|E|
PROOF: Each edge βeβ of G connects its end points vα΅’ and vβ±Ό. This edge contributes 1 to the degree of vα΅’ and 1 to the degree of vβ±Ό. If βeβ is a loop, then it is counted twice. Accordingly, each edge contributes 2 to the total degree of G.
COROLLARY: The total degree of G is an even number.
π Example: A graph with four vertices of degrees 1, 2, 3 and 3 has total degree = 9 (odd), which is not possible since total degree must be even.
π Example: A graph with vertices of degrees 1, 1, 4, 4 and 6 has total degree = 16. Using the Handshaking Theorem, 16 = 2Β·(number of edges), so number of edges = 8.
π Example: In a group of 15 people, is it possible for each person to have exactly 3 friends? Such a graph would have 15 vertices each of degree 3, for a total degree of 45 (odd), which is not possible. Hence, it is not possible.
COMPLETE GRAPH
A complete graph on n vertices is a simple graph in which each vertex is connected to every other vertex and is denoted by Kβ.
The following are complete graphs Kβ, Kβ, Kβ, Kβ and Kβ .
π Example: For the complete graph Kβ: (i) deg(v) = n - 1 for every v in Kβ. (ii) Total degree in Kβ = n(n - 1). (iii) Number of edges in Kβ = C(n, 2) = n(n-1)/2.
REGULAR GRAPH
A graph G is regular of degree k or k-regular if every vertex of G has degree k. In other words, a graph is regular if every vertex has the same degree.
Remark: The complete graph Kβ is (n-1) regular.
π Example: Draw two 3-regular graphs with six vertices. Possible examples include cycles and other configurations where each of the six vertices has exactly 3 incident edges.
BIPARTITE GRAPH
A bipartite graph G is a simple graph whose vertex set can be partitioned into two mutually disjoint non empty subsets A and B such that the vertices in A may be connected to vertices in B, but no vertices in A are connected to vertices in A and no vertices in B are connected to vertices in B.
DETERMINING BIPARTITE GRAPHS: The following labeling procedure determines whether a graph is bipartite or not:
- Label any vertex a
- Label all vertices adjacent to a with the label b.
- Label all vertices that are adjacent to a vertex just labeled b with label a.
- Repeat steps 2 and 3 until all vertices got a distinct label (a bipartite graph) or there is a conflict i.e., a vertex is labeled with a and b (not a bipartite graph).
π Example: If the labeling procedure results in a vertex being labeled both a and b, the graph is not bipartite. If each vertex gets a distinct label, the graph is bipartite.
COMPLETE BIPARTITE GRAPH
A complete bipartite graph on (m+n) vertices denoted Kβ,β is a simple graph whose vertex set can be partitioned into two mutually disjoint non empty subsets A and B containing m and n vertices respectively, such that each vertex in set A is connected (adjacent) to every vertex in set B, but the vertices within a set are not connected.
Examples include Kβ,β and Kβ,β.
β Key Takeaways
The Handshaking Theorem is the most critical concept: the sum of all vertex degrees must always equal twice the number of edges, making the total degree an even number. Understanding the distinction between a simple graph (no loops or parallel edges) and graphs that allow such features is essential. The degree of a loop is counted twice, which is a common exam point. For complete graphs Kβ, every vertex has degree (n-1) and there are n(n-1)/2 edges. The labeling procedure (a/b labeling) is a practical method to test if a graph is bipartite β a conflict indicates non-bipartiteness.
π§ Quick Revision Questions
- What is a loop in a graph, and how is its degree counted?
- State the Handshaking Theorem and explain why the total degree of any graph must be even.
- How many edges does a complete graph Kβ have?
- What is the labeling procedure to determine if a graph is bipartite?
- Explain why no simple graph can exist with four vertices of degrees 1, 2, 3, and 4.