#set document(title: "4.4 Union and Intersection", author: "Rachel Webb") #set page(width: 8.5in, height: auto, margin: 1in) #import "@preview/cetz:0.5.2" #set text(font: ("STIX Two Text", "Libertinus Serif", "New Computer Modern"), size: 10.5pt, lang: "en") #show math.equation: set text(font: ("STIX Two Math", "New Computer Modern Math")) #set par(justify: true, leading: 0.62em, spacing: 0.9em) #set enum(spacing: 1.1em) // room between list items so tall inline fractions don't collide #set list(spacing: 1.1em) #set table(stroke: 0.5pt + rgb("#c7ccd3")) #let BLUE = rgb("#183B6F") // brand navy — section bars + example/solution labels (white on navy 11.09:1) #let ORANGE = rgb("#A94509") // brand primary-700 — AA-safe deep orange for TEXT (5.93:1 on white; raw brand #F37021 is 2.94:1 and must never carry text) #let RED = rgb("#DC2626") // brand error-600 #let GREEN = rgb("#059669") // brand success-600 (decoration only; small green text uses green-text #007942) #show heading.where(level: 1): it => block(width: 100%, above: 0pt, below: 16pt, fill: gradient.linear(BLUE, rgb("#2C5AA0")), inset: (x: 14pt, y: 12pt), radius: 3pt, text(fill: white, weight: "bold", size: 19pt, it.body)) #show heading.where(level: 2): it => block(width: 100%, above: 18pt, below: 10pt, fill: BLUE, inset: (x: 10pt, y: 6pt), radius: 2pt, text(fill: white, weight: "bold", size: 12pt, it.body)) #show heading.where(level: 3): it => text(fill: ORANGE, weight: "bold", size: 12.5pt, it.body) #show heading.where(level: 4): it => text(fill: BLUE, weight: "bold", size: 10.5pt, it.body) #let examplebox(label, title, body) = block(width: 100%, breakable: true, fill: rgb("#EFF1F5"), stroke: 0.5pt + rgb("#CFDDF0"), radius: 4pt, inset: 10pt, above: 12pt, below: 12pt)[ #block(below: 6pt)[#box(fill: BLUE, inset: (x: 6pt, y: 2pt), radius: 2pt, text(fill: white, weight: "bold", size: 8.5pt, label)) #h(0.4em) #strong[#title]] #body] // rail = decorative left rule (raw brand token); labelcolor = AA-safe label text shade #let notebox(label, rail, labelcolor, tint, body) = block(width: 100%, breakable: true, fill: tint, stroke: (left: 3pt + rail), inset: (left: 10pt, rest: 8pt), radius: (right: 4pt), above: 11pt, below: 11pt)[ #text(fill: labelcolor, weight: "bold", size: 7.5pt, tracking: 0.5pt)[#upper(label)] #linebreak() #body] #let solutionbox(body) = block(above: 4pt, below: 8pt)[ #text(fill: BLUE, weight: "bold", size: 8.5pt)[Solution] #linebreak() #body] #let figph(msg) = block(width: 100%, height: 60pt, fill: rgb("#f6f7f9"), stroke: (paint: rgb("#c7ccd3"), dash: "dashed"), radius: 4pt, inset: 10pt)[ #align(center + horizon, text(fill: rgb("#889"), style: "italic", size: 9pt, msg))] // Standardize inlined figure sizes: measure the natural CeTZ canvas, then scale to a // consistent envelope (aspect-aware; see build_typst.py FIG_* constants). Unlike the // print preamble, dimensions are FLOORED: in an editor a user can trim a figure to a // degenerate 1-D shape (a bare line), and w/h or tw/w would then divide by zero. #let _STD_W = 3.5 #let _WIDE_W = 5.6 #let _MAX_H = 3.4 #let _ASPECT_WIDE = 2.2 #let _UPSCALE_MAX = 1.15 #let stdfig(body) = context { let m = measure(body) let w = calc.max(m.width / 1in, 0.01) let h = calc.max(m.height / 1in, 0.01) let tw = if w / h > _ASPECT_WIDE { _WIDE_W } else { _STD_W } let s = calc.min(tw / w, _MAX_H / h, _UPSCALE_MAX) align(center, box(scale(x: s * 100%, y: s * 100%, reflow: true, body))) } #show figure: set block(breakable: false) #set figure(gap: 8pt) #show figure.caption: set text(size: 8.5pt, fill: rgb("#555")) == 4.4#h(0.6em)Union and Intersection When two events cannot happen at the same time, they are called #strong[mutually exclusive] or#strong[disjoint events.] #figure(figph[Venn diagram titled Mutually Exclusive: a rectangle containing two separate circles with no overlap, a blue circle labeled A and a yellow circle labeled B.], alt: "Venn diagram titled Mutually Exclusive: a rectangle containing two separate circles with no overlap, a blue circle labeled A and a yellow circle labeled B.", caption: none) Figure 4-7 #figure(figph[Venn diagram titled Not Mutually Exclusive: overlapping blue and yellow circles labeled A and B, with the green overlapping region labeled A ∩ B.], alt: "Venn diagram titled Not Mutually Exclusive: overlapping blue and yellow circles labeled A and B, with the green overlapping region labeled A ∩ B.", caption: none) Figure 4-8 #figure(figph[Venn diagram of two separate, non-overlapping circles in a rectangle: a blue circle labeled Freshman and a yellow circle labeled Sophomore, showing mutually exclusive events.], alt: "Venn diagram of two separate, non-overlapping circles in a rectangle: a blue circle labeled Freshman and a yellow circle labeled Sophomore, showing mutually exclusive events.", caption: none) Figure 4-9 #figure(figph[Venn diagram of overlapping circles labeled Freshman in blue and Business Majors in yellow, with a green shaded region where the two circles overlap.], alt: "Venn diagram of overlapping circles labeled Freshman in blue and Business Majors in yellow, with a green shaded region where the two circles overlap.", caption: none) Figure 4-10 For example, a student cannot be a freshman and a sophomore at the same time, see Figure 4-9. These are mutually exclusive events. A student could be freshman and a business major at the same time so the event freshman and the event business major are not mutually exclusive see Figure 4-10. #strong[Intersection] When we are finding the probability of both A #strong[and]B happening at the same time we denote this as P(A ∩ B). This overlap is called the intersection. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ When two events, say A and B, occur at the same time, this is denoted as the #strong[intersection]of A and B and is denoted as (A ∩ B). Think of the symbol ∩ as an A in “and.” ] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ If two events are mutually exclusive then A ∩ B = { } the empty set (also denoted as #math.equation(block: false, alt: "the empty set")[$∅$]) and the P(A ∩ B) = 0. ] #strong[Union] When either event A, event B, or both occur then we call this the #strong[union]of A or B, which is denoted as (A U B). When finding the probability of A or B we denote this as P(A U B). When we write “or” in statistics, we mean “and/or” unless we explicitly state otherwise. Thus, A or B occurs means A, B, or both A and B occur. Figure 4-11 is a Venn diagram for the union rule. #figure(figph[Venn diagram of two overlapping circles shaded entirely green, labeled A ∪ B below, showing that the union includes everything in either circle.], alt: "Venn diagram of two overlapping circles shaded entirely green, labeled A ∪ B below, showing that the union includes everything in either circle.", caption: none) Figure 4-11 #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #strong[The Union Rule:] P(A U B) = P(A) + P(B) – P(A ∩ B). ] If two events are mutually exclusive, then the probability of them occurring at the same time is P(A ∩ B) = 0. So, if A and B are mutually exclusive then the P(A U B) = P(A) + P(B) as shown in Figure 4-7. It is best to write out the rule with the intersection so that you do not forget to subtract any overlapping intersection. #examplebox("Example 1")[][ The family college data set contains a sample of 792 cases with two variables, teen and parents. The teen variable is either college or not, where the college label means the teen went to college immediately after high school. The parent’s variable takes the value degree if at least one parent of the teenager completed a college degree. Make a Venn Diagram for the data. Example from OpenIntroStatistics. #figure(figph[Contingency table of teen college attendance by parent education: with a parent degree, 231 teens went to college and 49 did not; with no degree, 214 went and 298 did not; row totals 445 and 347, column totals 280 and 512, grand total 792.], alt: "Contingency table of teen college attendance by parent education: with a parent degree, 231 teens went to college and 49 did not; with no degree, 214 went and 298 did not; row totals 445 and 347, column totals 280 and 512, grand total 792.", caption: none) #solutionbox[ Find the relative frequencies. #figure(figph[Relative frequency table for teen college attendance by parent education: College row 0.29 degree, 0.27 no degree, 0.56 total; No College row 0.06, 0.38, 0.44; column totals 0.35 and 0.65 with an overall total of 1.], alt: "Relative frequency table for teen college attendance by parent education: College row 0.29 degree, 0.27 no degree, 0.56 total; No College row 0.06, 0.38, 0.44; column totals 0.35 and 0.65 with an overall total of 1.", caption: none) Figure 4-12 for completed Venn Diagram. Note that you do not need to use circles to represent the sets. #figure(figph[Venn-style diagram drawn with rectangles: a blue dashed rectangle for teenager went to college and a red dotted rectangle for parent completed a college degree overlap in a gray region labeled 0.29; the college-only region is 0.27, the degree-only region is 0.06, and Neither is 0.38.], alt: "Venn-style diagram drawn with rectangles: a blue dashed rectangle for teenager went to college and a red dotted rectangle for parent completed a college degree overlap in a gray region labeled 0.29; the college-only region is 0.27, the degree-only region is 0.06, and Neither is 0.38.", caption: none) Figure 4-12 ] ] #examplebox("Example 2")[][ A random sample of 500 people was taken from the 2010 United States Census. Their marital status and race were recorded in the following contingency table using the census labels. A person is randomly chosen from the census data. Find the following. Race   Marital Status American Indian Black Asian White Two Major Races Total Divorced 0 6 1 30 1 38 Married 1 25 23 156 4 209 Single 2 33 21 155 11 222 Widowed 0 7 2 22 0 31 Total 3 71 47 363 16 500 a) P (Single ∩ American Indian) b) P(Single U American Indian) c) Probability that the person is Asian or Married. d) P(Single ∩ Married) e) P(Single U Married) #solutionbox[ a) The intersection for a contingency table is found by simply finding where the row or intersection meets. There are 2 Single American Indians, therefore the P(Single ∩ American Indian) = P(Single and American Indian) = 2/500 = 0.004. b) There are 222 Single people, there are 3 American Indians, but we do not want to count the 2 Single American Indians twice, therefore the P(Single U American Indian) = P(Single or American Indian) = 222/500 + 3/500 – 2/500 = 223/500 = 0.446. c) The union for a contingency table is found by either using the union formula or adding up all the numbers in the corresponding row and column. There are 47 Asian people, there are 209 Married people, but we do not want to count the 23 Married Asian people twice, therefore the P(Asian U Married) = P(Asian or Married) = 47/500 + 209/500 – 23/500 = 233/500 = 0.466. d) The events Single and Married are mutually exclusive so the P(Single ∩ Married) = 0. Alternatively, there is no place in the table where the Single row and Married row meet. e) The events single and married are mutually exclusive so the P(Single U Married) = P(Single) + P(Married) – P(Single ∩ Married) = 222/500 + 209/500 – 0 = 431/500 = 0.862. ] ] #examplebox("Example 3")[][ Use a random experiment consisting of rolling two dice and adding the numbers on the faces. a) Compute the probability of rolling a sum of 8. b) Compute the probability of rolling a sum of 8 or a sum of 5 c) Compute the probability of rolling a sum of 8 or a double (each die has the same number). #solutionbox[ a) There are 36 possible outcomes for rolling the two dice as shown in the following sum table. There are 5 pairs where the sum of the two dice is an 8, the (2,6), (3,5), (4,4), (5,3) and (6,2). Note that the events (2,6) and (6,2) are different outcomes since they numbers come from different dice. #figure(figph[Sum table for rolling two dice, with rows for the first die 1 to 6 and columns for the second die 1 to 6 showing sums 2 through 12; the five cells that sum to 8 — (2,6), (3,5), (4,4), (5,3), and (6,2) — are shaded blue.], alt: "Sum table for rolling two dice, with rows for the first die 1 to 6 and columns for the second die 1 to 6 showing sums 2 through 12; the five cells that sum to 8 — (2,6), (3,5), (4,4), (5,3), and (6,2) — are shaded blue.", caption: none) Thus, the P(8) = 5/36 = 0.1389. b) Highlight all the places where a sum of 5 or a sum of 8 occurs. There are 9 pairs where the sum of the two dice is a 5 or an 8. #figure(figph[Sum table for rolling two dice with nine cells shaded blue: the four combinations that sum to 5 and the five combinations that sum to 8.], alt: "Sum table for rolling two dice with nine cells shaded blue: the four combinations that sum to 5 and the five combinations that sum to 8.", caption: none) Thus, the P(5 U 8) = P(5) + P(8) – P(5 ∩ 8) = 4/36 + 5/36 – 0 = 9/36 = 0.25. Note that rolling a sum of 5 is mutually exclusive from rolling a sum of 8 so the probability is zero for the intersection of the two events. c) The events rolling an 8 and rolling doubles are not mutually exclusive since the pair of fours (4, 4) falls into both events. An easy way is to highlight all the places a sum 8 or doubles occur, count the highlighted values, and divide by the total 10/36 = 0.2778. #figure(figph[Sum table for rolling two dice with ten cells shaded blue: the six doubles along the diagonal, with sums 2, 4, 6, 8, 10, and 12, plus the four other combinations that sum to 8.], alt: "Sum table for rolling two dice with ten cells shaded blue: the six doubles along the diagonal, with sums 2, 4, 6, 8, 10, and 12, plus the four other combinations that sum to 8.", caption: none) When using the union rule, we subtract this overlap out one time to account for this. Using the union formula: P(8 U Doubles) = P(8) + P(Doubles) – P(8 ∩ Doubles) = 5/36 + 6/36 – 1/36 = 10/36 = 0.2778. ] ] “‘It's... well, it's a long story,’ he said, ‘but the Question I would like to know is the Ultimate Question of Life, the Universe and Everything. All we know is that the Answer is Forty-two, which is a little aggravating.’ Prak nodded again. ‘Forty-two,’ he said. ‘Yes, that's right.’ He paused. Shadows of thought and memory crossed his face like the shadows of clouds crossing the land. ‘I'm afraid,’ he said at last, ‘that the Question and the Answer are mutually exclusive. Knowledge of one logically precludes knowledge of the other. It is impossible that both can ever be known about the same universe.’” (Adams, 2002) #examplebox("Example 4")[][ Randomly pick a card from a standard deck. A standard deck of cards, not including jokers consists of 4 suits called clubs = ♣, spades = ♠, hearts = ♥, and diamonds = ♦. The clubs and spades are called the black cards. The hearts and diamonds are called the red cards. Each suit has 13 cards. The numbered cards shown in Figure 4-13, are Ace = 1 or A, 2, 3, 4, 5, 6, 7, 8, 9, 10. The face cards are the Jack = J, Queen = Q, and King = K. #figure(figph[Standard deck of 52 playing cards laid out in four rows by suit — clubs, spades, hearts, diamonds — with columns running ace through 10, then jack, queen, king; clubs and spades are black, hearts and diamonds are red.], alt: "Standard deck of 52 playing cards laid out in four rows by suit — clubs, spades, hearts, diamonds — with columns running ace through 10, then jack, queen, king; clubs and spades are black, hearts and diamonds are red.", caption: none) Figure 4-13 a) Compute the probability of selecting a card that shows a club. b) Compute the probability of selecting a heart or a spade card. c) Compute the probability of selecting a spade or a face card. #solutionbox[ a) There are 52 cards in a standard deck. There are 13 cards of each suit. The P(♣) = 13/52 = 0.25. b) There are 52 cards in a standard deck. There are 13 cards of each suit. P(♥ U ♠) = 26/52 = 0.5. c) There are 13 spades and 12 face cards. However, there are 3 cards that are both spades and face cards. P(♠ U FC) = P(♠) + P(FC) – P(♠ ∩ FC) = 13/52 + 12/52 – 3/52 = 22/52 = 0.4231. Since the sample space is small, you could just count how many spades and face cards there are. #figure(figph[Deck of 52 cards arranged by suit with blue outlines highlighting the entire spades row and the jack, queen, and king columns of every suit, illustrating the union of spades and face cards.], alt: "Deck of 52 cards arranged by suit with blue outlines highlighting the entire spades row and the jack, queen, and king columns of every suit, illustrating the union of spades and face cards.", caption: none) ] ] #strong[Words Are Important!] When working with probability, words such as “more than” or “less than” can drastically change the answer. Figure 4-14 shows some of the common phrases you may run into while reading a problem. It will be essential later in the course that you can correctly match these phrases with their correct symbol. #figure(figph[Table matching phrases to inequality symbols: = (is the same as, is equal to, is exactly the same as, has not changed from); ≤ (is at most, is not greater than, within); ≥ (is at least, is not less than); ≠ (is not, is different from, has changed from); \> (more than, above, higher than, bigger than, increased); \< (less than, below, lower than, smaller than, decreased, reduced).], alt: "Table matching phrases to inequality symbols: = (is the same as, is equal to, is exactly the same as, has not changed from); ≤ (is at most, is not greater than, within); ≥ (is at least, is not less than); ≠ (is not, is different from, has changed from); > (more than, above, higher than, bigger than, increased); < (less than, below, lower than, smaller than, decreased, reduced).", caption: none) Figure 4-14 #examplebox("Example 5")[][ Use a random experiment consisting of rolling two dice and adding the numbers on the faces. a) Compute the probability of rolling a sum of less than 5. b) Compute the probability of rolling a sum of 5 or less. #solutionbox[ a) Let X be the event rolling a sum less than 5. A sum less than 5 would not include the 5. For notation, we use P(X \< 5), which is read as the “probability that X is less than five.” Shade in all the sums that are less than 5. #figure(figph[Sum table for rolling two dice with the six cells whose sums are less than 5 shaded blue: sums of 2, 3, and 4 in the upper left corner of the table.], alt: "Sum table for rolling two dice with the six cells whose sums are less than 5 shaded blue: sums of 2, 3, and 4 in the upper left corner of the table.", caption: none) Then the P(X \< 5) = 6/36 = 0.1667. b) : Let X be the event rolling a sum of 5 or less. A sum of 5 or less includes the 5. For notation, we can use P(X ≤ 5), which is read as the “probability that X is less than or equal to five.” Shade in all the sums that are 5 or less. #figure(figph[Sum table for rolling two dice with the ten cells whose sums are 5 or less shaded blue, filling the upper left corner of the table.], alt: "Sum table for rolling two dice with the ten cells whose sums are 5 or less shaded blue, filling the upper left corner of the table.", caption: none) Then the P(X ≤ 5) = 10/36 = 0.2778. ] ]