Skip to main content
Statistics LibreTexts

3.5: Contingency Tables and Probability Trees

  • Page ID
    40729
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    A contingency table provides a way of portraying data that can facilitate calculating probabilities. The table helps in determining conditional probabilities quite easily. The table displays sample values in relation to two different variables that may be dependent or contingent on one another. Later on, we will use contingency tables again, but in another manner.

    Exercise \(\PageIndex{1}\)

    Suppose a study of speeding violations and drivers who use cell phones produced the following fictional data:

    Speeding violation in the last year No speeding violation in the last year Total
    Uses cell phone while driving 25 280 305
    Does not use cell phone while driving 45 405 450
    Total 70 685 755
    Table \(\PageIndex{1}\)

    The total number of people in the sample is 755. The row totals are 305 and 450. The column totals are 70 and 685. Notice that 305 + 450 = 755 and 70 + 685 = 755.

    Calculate the following probabilities using the table.

    a. Find P(Driver is a cell phone user).
    b. Find P(driver had no violation in the last year).
    c. Find P(Driver had no violation in the last year AND was a cell phone user).
    d. Find P(Driver is a cell phone user OR driver had no violation in the last year).
    e. Find P(Driver is a cell phone user GIVEN driver had a violation in the last year).
    f. Find P(Driver had no violation last year GIVEN driver was not a cell phone user)

    Answer

    a. \(\dfrac{\text { number of cell phone users }}{\text { total number in study }}=\dfrac{305}{755}\)

    b. \(\dfrac{\text { number that had no violation }}{\text { total number in study }}=\dfrac{685}{755}\)

    c. \(\dfrac{280}{755}\)

    d. \(\left(\dfrac{305}{755}+\dfrac{685}{755}\right)-\dfrac{280}{755}=\dfrac{710}{755}\)

    e. \(\dfrac{25}{70}\) (The sample space is reduced to the number of drivers who had a violation.)

    f. \(\dfrac{405}{450}\) (The sample space is reduced to the number of drivers who were not cell phone users.)

    Try It \(\PageIndex{1}\)

    Table \(\PageIndex{2}\) shows the number of athletes who stretch before exercising and how many had injuries within the past year.

    Injury in last year No injury in last year Total
    Stretches 55 295 350
    Does not stretch 231 219 450
    Total 286 514 800

    Table \(\PageIndex{2}\)

    1. What is P(athlete stretches before exercising)?
    2. What is P(athlete stretches before exercising||no injury in the last year)?
    Exercise \(\PageIndex{2}\)

    Table (\PageIndex{3}\) shows a random sample of 100 hikers and the areas of hiking they prefer.

    Sex The Coastline Near Lakes and Streams On Mountain Peaks Total
    Women 18 16 45
    Men 14 55
    Total 41
    Table \(\PageIndex{3}\) Hiking Area Preference

    a. Complete the table.

    b. Are the events "being a woman" and "preferring the coastline" independent events?

    Let \(F=\) being a woman and let \(C=\) preferring the coastline.
    1. Find \(P(F \cap C)\).
    2. Find \(P(F) P(C)\)

    Are these two numbers the same? If they are, then \(F\) and \(C\) are independent. If they are not, then \(F\) and \(C\) are not independent.

    c. Find the probability that a person is a man given that the person prefers hiking near lakes and streams. Let \(M=\) being a man, and let \(L=\) prefers hiking near lakes and streams.

    1. What word tells you this is a conditional?
    2. Fill in the blanks and calculate the probability: \(P\) ( \(\qquad\) | \(\qquad\) ) = \(\qquad\).
    3. Is the sample space for this problem all 100 hikers? If not, what is it?

    d. Find the probability that a person is a woman or prefers hiking on mountain peaks. Let \(F=\) being a woman, and let \(P=\) prefers mountain peaks.

    1. Find \(P(F)\).
    2. Find \(P(P)\).
    3. Find \(P(F \cap P)\).
    4. Find \(P(F \cup P)\).

    Answer

    a.

    Sex The coastline Near lakes and streams On mountain peaks Total
    Women 18 16 11 45
    Men 16 25 14 55
    Total 34 41 25 100

    Table \(\PageIndex{4}\) Hiking Area Preference

    b.

    1. \(P(F \cap C)=\dfrac{18}{100}=0.18\)
    2. \(P(F) P(C)=\left(\dfrac{45}{100}\right)\left(\dfrac{34}{100}\right)=(0.45)(0.34)=0.153\)
    \(P(F \cap C) \neq P(F) P(C)\), so the events \(F\) and \(C\) are not independent.

    c.

    1. The word 'given' tells you that this is a conditional.
    2. \(P(M \mid L)=\dfrac{25}{41}\)
    3. No, the sample space for this problem is the 41 hikers who prefer lakes and streams.

    d.

    1. \(P(F)=\dfrac{45}{100}\)
    2. \(P(P)=\dfrac{25}{100}\)
    3. \(P(F \cap P)=\dfrac{11}{100}\)
    4. \(P(F \cup P)=\dfrac{45}{100}+\dfrac{25}{100}-\dfrac{11}{100}=\dfrac{59}{100}\)

    Try It \(\PageIndex{2}\)

    Table \(\PageIndex{5}\) shows a random sample of 200 cyclists and the routes they prefer. Let O = older and H = hilly path.

    Age Group Lake Path Hilly Path Wooded Path Total
    Younger 45 38 27 110
    Older 26 52 12 90
    Total 71 90 39 200
    Table \(\PageIndex{5}\)
    1. Out of the older group, what is the probability that the cyclist prefers a hilly path?
    2. Are the events “being older” and “preferring the hilly path” independent events?
    Exercise \(\PageIndex{3}\)

    Muddy Mouse lives in a cage with three doors. If Muddy goes out the first door, the probability that he gets caught by Alissa the cat is \(\dfrac{1}{5}\) and the probability he is not caught is \(\dfrac{4}{5}\). If he goes out the second door, the probability he gets caught by Alissa is \(\dfrac{1}{4}\) and the probability he is not caught is \(\dfrac{3}{4}\). The probability that Alissa catches Muddy coming out of the third door is \(\dfrac{1}{2}\) and the probability she does not catch Muddy is \(\dfrac{1}{2}\). It is equally likely that Muddy will choose any of the three doors so the probability of choosing each door is \(\dfrac{1}{3}\).

    Caught or Not Door One Door Two Door Three Total
    Caught \(\dfrac{1}{15}\)115 \(\dfrac{1}{12}\) 1\(\dfrac{1}{6}\)16 -
    Not Caught \(\dfrac{4}{15}\) \(\dfrac{3}{12}\) \(\dfrac{1}{6}\) -
    Total - - - 1
    Table \(\PageIndex{6}\) Door Choice
    • The first entry \(\dfrac{1}{15}=\left(\dfrac{1}{5}\right)\left(\dfrac{1}{3}\right)\) is \(P(\) Door One \(\cap\) Caught)
    • The entry \(\dfrac{4}{15}=\left(\dfrac{4}{5}\right)\left(\dfrac{1}{3}\right)\) is \(P\) (Door One \(\cap\) Not Caught)

    Verify the remaining entries.

    Problem
    a. Complete the probability contingency table. Calculate the entries for the totals. Verify that the lower-right corner entry is 1 .

    b. What is the probability that Alissa does not catch Muddy?

    c. What is the probability that Muddy chooses Door One OR Door Two given that Muddy is caught by Alissa?

    Answer

    a.

    Caught or Not Door One Door Two Door Three Total
    Caught \(\dfrac{1}{15}\)115 \(\dfrac{1}{12}\) 1\(\dfrac{1}{6}\)16 \(\dfrac{19}{60}\)
    Not Caught \(\dfrac{4}{15}\) \(\dfrac{3}{12}\) \(\dfrac{1}{6}\) \(\dfrac{41}{60}\)
    Total \(\dfrac{5}{15}\) \(\dfrac{4}{12}\) \(\dfrac{2}{6}\) 1
    Table \(\PageIndex{7}\) Door Choice
    b. \(\dfrac{41}{60}\)
    c. \(\dfrac{9}{19}\)
    Try It \(\PageIndex{3}\)

    Fred's preference to drink coffee or iced tea depends on the season. When it is summer, Fred's preference to drink coffee is \(\dfrac{1}{4}\), and his preference to drink iced tea is \(\dfrac{3}{4}\). When it is rainy season, Fred's preference to drink coffee is \(\dfrac{1}{2}\), and his preference to drink iced tea is \(\dfrac{1}{2}\). When it is winter, Fred's preference to drink coffee is \(\dfrac{1}{5}\), and his preference to drink iced tea is \(\dfrac{1}{5}\). A day randomly selected in a year has a probability of \(\dfrac{1}{3}\) for each season. The event here is selection of a day randomly in a year.

    Season Summer Rainy Winter Total
    Coffee \(\dfrac{1}{12}\) \(\dfrac{1}{6}\) \(\dfrac{4}{15}\) __
    Iced tea \(\dfrac{1}{4}\) \(\dfrac{1}{6}\) \(\dfrac{1}{15}\) __
    Total __ __ __ 1

    Table \(\PageIndex{8}\)

    Table 3.10

    • The first entry is \(\left(\dfrac{1}{4}\right)\left(\dfrac{1}{3}\right)=\dfrac{1}{12}\).
    • The second entry is \(\left(\dfrac{3}{4}\right)\left(\dfrac{1}{3}\right)=\dfrac{1}{4}\).

    Verify the remaining entries.
    a. Complete the probability contingency table. Calculate the entries for the totals. Verify that the lower-right corner entry is 1 .
    b. What is the probability that Fred will drink iced tea?
    c. What is the probability that the day is in summer or rainy season given that Fred drinks iced tea?

    Exercise \(\PageIndex{4}\)

    Table \(\PageIndex{9}\) contains the number of crimes per 100,000 inhabitants in the United States over the span of several years.

    Year Robbery Burglary Vandalism Vehicle Total
    1 145.7 732.1 29.7 314.7
    2 133.1 717.7 29.1 259.2
    3 119.3 701 27.7 239.1
    4 113.7 702.2 26.8 229.6
    Total
    Table \(\PageIndex{9}\) United States Crime Index Rates Per 100,000 Inhabitants

    TOTAL each column and each row. Total data = 4,520.7

    1. Find P (Year 2 AND Robbery).
    2. Find P (Year 3 AND Burglary).
    3. Find P (Year 3 OR Burglary).
    4. Find P (Year 4 | Vandalism).
    5. Find P (Vehicle | Year 1).
    Answer

    a. 0.0294, b. 0.1551, c. 0.7165, d. 0.2365, e. 0.2575

    Try It \(\PageIndex{4}\)

    Table \(\PageIndex{10}\) relates the weights and heights of a group of individuals participating in an observational study.

    Weight/height Tall Medium Short Totals
    Overweight 18 28 14
    Typical Weight Range 20 51 28
    Underweight 12 25 9
    Totals

    Table \(\PageIndex{10}\)

    1. Find the total for each row and column
    2. Find the probability that a randomly chosen individual from this group is Tall.
    3. Find the probability that a randomly chosen individual from this group is Overweight and Tall.
    4. Find the probability that a randomly chosen individual from this group is Tall given that the individual is Overweight.
    5. Find the probability that a randomly chosen individual from this group is Overweight given that the individual is Tall.
    6. Find the probability a randomly chosen individual from this group is Tall and Underweight.
    7. Are the events Overweight and Tall independent?

    This page titled 3.5: Contingency Tables and Probability Trees is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by OpenStax via source content that was edited to the style and standards of the LibreTexts platform.