<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/technology/cnxml/schema/dtd/0.5/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" xmlns:m="http://www.w3.org/1998/Math/MathML" id="new">
  <name>Probability Topics: Contingency Tables</name>
  <metadata>
  <md:version>1.5</md:version>
  <md:created>2008/05/27 15:12:56 GMT-5</md:created>
  <md:revised>2008/07/31 10:15:11.694 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="billowsky">
      <md:firstname>Barbara</md:firstname>
      
      <md:surname>Illowsky</md:surname>
      <md:email>illowskybarbara@deanza.edu</md:email>
    </md:author>
      <md:author id="sdean">
      <md:firstname>Susan</md:firstname>
      
      <md:surname>Dean</md:surname>
      <md:email>deansusan@deanza.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="cnxorg">
      <md:firstname/>
      
      <md:surname>Connexions</md:surname>
      <md:email>cnx@cnx.org</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>contingency</md:keyword>
    <md:keyword>elementary</md:keyword>
    <md:keyword>probability</md:keyword>
    <md:keyword>statistics</md:keyword>
    <md:keyword>table</md:keyword>
  </md:keywordlist>

  <md:abstract>This module introduces the contingency table as a way of determining conditional probabilities.</md:abstract>
</metadata>
   <content>
    <para id="element-864">A <term src="#contintable">contingency table</term> provides a different way of 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.</para><example id="element-775"><para id="element-557">
Suppose a study of speeding violations and drivers who use car phones produced the following fictional data:
</para><table id="element-838">
<tgroup cols="4"><thead>
  <row>
    <entry/>
    <entry>Speeding violation 
in the last year</entry>
    <entry>No speeding violation
in the last year</entry>
    <entry>Total</entry>
  </row>
</thead>
<tbody>

  <row>
    <entry>Car phone user</entry>
    <entry>25</entry>
    <entry>280</entry>
    <entry>305</entry>
  </row>
  <row>
    <entry>Not a car phone user</entry>
    <entry>45</entry>
    <entry>405</entry>
    <entry>450</entry>
  </row>
  <row>
    <entry>Total</entry>
    <entry>70</entry>
    <entry>685</entry>
    <entry>755</entry>
  </row>
</tbody>


</tgroup>
</table>
<para id="element-42">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 <m:math><m:mn>305</m:mn><m:mo> + </m:mo><m:mn>450</m:mn><m:mo> = </m:mo><m:mn>755</m:mn></m:math> and <m:math><m:mn>70</m:mn><m:mo> + </m:mo><m:mn>685</m:mn><m:mo> = </m:mo><m:mn>755</m:mn></m:math>.</para><para id="element-818">Calculate the following probabilities using the table</para>

<exercise id="element-101"><problem>
  <para id="element-101p">
   <m:math><m:mtext>P(person is a car phone user) = </m:mtext></m:math>
  </para>
 </problem>
 <solution>
  <para id="element-101s">
    <m:math>
     <m:mfrac>
      <m:mtext>number of car phone users </m:mtext>
      <m:mtext>total number in study</m:mtext>  
     </m:mfrac>
     <m:mi>=</m:mi>
     <m:mfrac>
      <m:mn>305</m:mn>
      <m:mn>755</m:mn>
     </m:mfrac>
    </m:math>
  </para>
 </solution>
</exercise>

<exercise id="element-102"><problem>
  <para id="element-102p">
   <m:math><m:mtext>P(person had no violation in the last year)  = </m:mtext></m:math>
  </para>
 </problem>
 <solution>
  <para id="element-102s">
   <m:math>
    <m:mfrac>
     <m:mtext>number that had no violation</m:mtext>
     <m:mtext>total number in study</m:mtext>  
    </m:mfrac>
    <m:mi>=</m:mi>
    <m:mfrac>
     <m:mn>685</m:mn>
     <m:mn>755</m:mn>
    </m:mfrac>
   </m:math>
  </para>
 </solution>
</exercise>


<exercise id="element-103"><problem>
  <para id="element-103p">
  <m:math><m:mtext>P(person had no violation in the last year AND was a car phone user)   =</m:mtext></m:math>
  </para>
 </problem>
 <solution>
  <para id="element-103s">
<m:math><m:mfrac>
    <m:mn>280</m:mn>
    <m:mn>755</m:mn>

  </m:mfrac></m:math>
  </para>
 </solution>
</exercise>


<exercise id="element-104"><problem>
  <para id="element-104p">
  <m:math><m:mtext>P(person is a car phone user OR person had no violation in the last year)   =</m:mtext></m:math>
  </para>
 </problem>
 <solution>
  <para id="element-104s"><m:math>
<m:mo>(</m:mo>
<m:mfrac>
    <m:mn>305</m:mn>
    <m:mn>755</m:mn>
  </m:mfrac><m:mi>+</m:mi>
<m:mfrac>
    <m:mn>685</m:mn>
    <m:mn>755</m:mn>
  </m:mfrac>
<m:mo>)</m:mo><m:mi> - </m:mi>
<m:mfrac>
    <m:mn>280</m:mn>
    <m:mn>755</m:mn>
  </m:mfrac><m:mi>=</m:mi>
<m:mfrac>
    <m:mn>710</m:mn>
    <m:mn>755</m:mn>
  </m:mfrac>
</m:math>
  </para>
 </solution>
</exercise>


<exercise id="element-105"><problem>
  <para id="element-105p">
  <m:math><m:mtext>P(person is a car phone user GIVEN person had a violation in the last year)   =  </m:mtext></m:math>
  </para>
 </problem>
 <solution>
  <para id="element-105s">
<m:math><m:mfrac>
    <m:mn>25</m:mn>
    <m:mn>70</m:mn>
  </m:mfrac> </m:math>
   (The sample space is reduced to the number of persons who had a violation.)
  </para>
 </solution>
</exercise>


<exercise id="element-107"><problem>
  <para id="element-107p">
  <m:math><m:mtext>P(person had no violation last year GIVEN person was not a car phone user)   =  </m:mtext></m:math>
  </para>
 </problem>
 <solution>
  <para id="element-107s">
<m:math><m:mfrac>
    <m:mn>405</m:mn>
    <m:mn>450</m:mn>
  </m:mfrac> </m:math>
(The sample space is reduced to the number of persons who were not car phone users.) 
  </para>
 </solution>
</exercise>
</example>
<example id="element-511"><para id="element-98">The following table shows a random sample of 100 hikers and the areas of hiking preferred:
</para><table id="element-850">
<name>Hiking Area Preference</name>
<tgroup cols="5"><thead>
  <row>
    <entry>Sex</entry>
    <entry>The Coastline</entry>
    <entry>Near Lakes and Streams</entry>
    <entry>On Mountain Peaks</entry>
    <entry>Total</entry>
  </row>
</thead>
<tbody>
  <row>
    <entry>Female</entry>
    <entry>18</entry>
    <entry>16</entry>
    <entry>___</entry>
    <entry>45</entry>

  </row>
  <row>
    <entry>Male</entry>
    <entry>___</entry>
    <entry>___</entry>
    <entry>14</entry>
    <entry>55</entry>
  </row>
  <row>
    <entry>Total</entry>
    <entry>___</entry>
    <entry>41</entry>
    <entry>___</entry>
    <entry>___</entry>
  </row>
</tbody>

</tgroup>
</table><exercise id="element-227"><?solution_in_back?>
<problem>
  <para id="element-665">
    Complete the table.
  </para>
</problem>

<solution>
 <table id="element-850s">
<name>Hiking Area Preference</name>
<tgroup cols="5"><thead>
  <row>
    <entry>Sex</entry>
    <entry>The Coastline</entry>
    <entry>Near Lakes and Streams</entry>
    <entry>On Mountain Peaks</entry>
    <entry>Total</entry>
  </row>
</thead>
<tbody>
  <row>
    <entry>Female</entry>
    <entry>18</entry>
    <entry>16</entry>
    <entry><emphasis>11</emphasis></entry>
    <entry>45</entry>

  </row>
  <row>
    <entry>Male</entry>
    <entry><emphasis>16</emphasis></entry>
    <entry><emphasis>25</emphasis></entry>
    <entry>14</entry>
    <entry>55</entry>
  </row>
  <row>
    <entry>Total</entry>
    <entry><emphasis>34</emphasis></entry>
    <entry>41</entry>
    <entry><emphasis>25</emphasis></entry>
    <entry><emphasis>100</emphasis></entry>
  </row>
</tbody>

</tgroup>
</table>
</solution>
</exercise><exercise id="element-754"><?solution_in_back?>
<problem>
  <para id="element-891">
    Are the events "being female" and "preferring the coastline" independent events?
  </para>
  <para id="element-123">
    Let <m:math><m:mi>F</m:mi></m:math> = being female and let <m:math><m:mi>C</m:mi></m:math> = preferring the coastline.
  </para>
  <list id="element-1242" type="named-item">
   <?mark .?>
   <item><name>a</name><m:math><m:mtext>P(F AND C)</m:mtext></m:math> =</item>
   <item><name>b</name><m:math><m:mi>P(F)</m:mi><m:mo> ⋅ </m:mo><m:mi>P(C)</m:mi></m:math> =</item>
  </list>
  <para id="element-3532">
   Are these two numbers the same?  If they are, then <m:math><m:mi>F</m:mi></m:math> and <m:math><m:mi>C</m:mi></m:math> are independent.  If they are not, then <m:math><m:mi>F</m:mi></m:math> and <m:math><m:mi>C</m:mi></m:math> are not independent.</para>
</problem>

<solution>
  <list id="element-3256" type="named-item"><?mark .?>
  <item><name>a</name>
   <m:math>
    <m:mtext>P(F AND C)</m:mtext>
    <m:mo> = </m:mo>
    <m:mfrac>
     <m:mn>18</m:mn>
     <m:mn>100</m:mn>
    </m:mfrac>
    <m:mo> = </m:mo>
    <m:mn>0.18</m:mn>
   </m:math>
  </item>
  
  <item><name>b</name>
   <m:math>
    <m:mi>P(F)</m:mi><m:mo> ⋅ </m:mo><m:mi>P(C)</m:mi>
    <m:mo> = </m:mo>
    <m:mfrac>
     <m:mn>45</m:mn>
     <m:mn>100</m:mn>
    </m:mfrac>
    <m:mo> ⋅ </m:mo>
    <m:mfrac>
     <m:mn>45</m:mn>
     <m:mn>100</m:mn>
    </m:mfrac>
    <m:mo> = </m:mo>
    <m:mn>0.45</m:mn>
    <m:mo> ⋅ </m:mo>    
    <m:mn>0.45</m:mn>
    <m:mo> = </m:mo>
    <m:mn>0.153</m:mn>
   </m:math>
  </item>
  </list>

  <para id="element-404"><m:math>
    <m:mtext>P(F AND C)</m:mtext>
    <m:mo> ≠ </m:mo>
    <m:mi>P(F)</m:mi><m:mo> ⋅ </m:mo><m:mi>P(C)</m:mi></m:math>, so the events <m:math><m:mi>F</m:mi></m:math> and <m:math><m:mi>C</m:mi></m:math> are not independent.

  </para>
</solution>
</exercise><exercise id="element-414"><?solution_in_back?>
<problem>
  <para id="element-717">
Find the probability that a person is male given that the person prefers hiking near lakes and streams.  Let <m:math><m:mtext>M</m:mtext></m:math> = being male and let <m:math><m:mtext>L</m:mtext></m:math> = prefers hiking near lakes and streams.
</para>

<list id="element-2341" type="named-item"><?mark .?>
<item><name>a</name>What word tells you this is a conditional? </item>
<item><name>b</name>Fill in the blanks and calculate the probability: <m:math><m:mtext>P(___|___)</m:mtext><m:mo> = </m:mo><m:mi>___</m:mi></m:math>.</item>
<item><name>c</name>Is the sample space for this problem all 100 hikers? If not, what is it?        </item>
</list>

</problem>

<solution>
<list id="element-2341s" type="named-item"><?mark .?>
<item><name>a</name>The word 'given' tells you that this is a conditional.</item>
<item><name>b</name><m:math><m:mtext>P(M|L)</m:mtext><m:mo> = </m:mo><m:mfrac><m:mn>25</m:mn><m:mn>41</m:mn></m:mfrac></m:math></item>
<item><name>c</name>No, the sample space for this problem is 41.</item>
</list>
</solution>
</exercise><exercise id="element-402"><?solution_in_back?><problem>
  <para id="element-715">
   Find the probability that a person is female or prefers hiking on mountain peaks.
   Let <m:math><m:mi>F</m:mi></m:math> = being female and let <m:math><m:mi>P</m:mi></m:math> = prefers mountain peaks.
  </para>

  <list id="list1213" type="named-item"><?mark .?>
   <item><name>a</name><m:math><m:mtext>P(F)</m:mtext><m:mo> = </m:mo></m:math> </item>     
   <item><name>b</name><m:math><m:mtext>P(P)</m:mtext><m:mo> = </m:mo></m:math> </item>
   <item><name>c</name><m:math><m:mtext>P(F AND P)</m:mtext><m:mo> = </m:mo></m:math></item>
   <item><name>d</name>Therefore, <m:math><m:mtext>P(F OR P)</m:mtext><m:mo> = </m:mo></m:math> </item>
</list>

</problem>

<solution>

  <list id="list1213s" type="named-item"><?mark .?>
   <item><name>a</name><m:math><m:mtext>P(F)</m:mtext><m:mo> = </m:mo><m:mfrac><m:mn>45</m:mn><m:mn>100</m:mn></m:mfrac></m:math> </item>     
   <item><name>b</name><m:math><m:mtext>P(P)</m:mtext><m:mo> = </m:mo><m:mfrac><m:mn>25</m:mn><m:mn>100</m:mn></m:mfrac></m:math> </item>
   <item><name>c</name><m:math><m:mtext>P(F AND P)</m:mtext><m:mo> = </m:mo><m:mfrac><m:mn>11</m:mn><m:mn>100</m:mn></m:mfrac></m:math></item>
   <item><name>d</name><m:math><m:mtext>P(F OR P)</m:mtext><m:mo> = </m:mo><m:mfrac><m:mn>45</m:mn><m:mn>100</m:mn></m:mfrac>  <m:mo> + </m:mo> <m:mfrac><m:mn>25</m:mn><m:mn>100</m:mn></m:mfrac> <m:mo> - </m:mo>  <m:mfrac><m:mn>11</m:mn><m:mn>100</m:mn></m:mfrac> <m:mo> = </m:mo><m:mfrac><m:mn>59</m:mn><m:mn>100</m:mn></m:mfrac></m:math> </item>
</list>
</solution>
</exercise>
</example><example id="element-883"><para id="element-700">Muddy Mouse lives in a cage with 3 doors.  If Muddy goes out the first door, the probability that he gets caught by Alissa the cat is <m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>5</m:mn>
  </m:mfrac>
  <m:mtext/>
</m:math> and the probability he is not caught is <m:math>
 <m:mfrac>
    <m:mn>4</m:mn>
    <m:mn>5</m:mn>
  </m:mfrac>
  <m:mtext/>
</m:math>.  If he goes out the second door, the probability he gets caught by Alissa is <m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>4</m:mn>
  </m:mfrac>
</m:math> and the probability he is not caught is <m:math>
 <m:mfrac>
    <m:mn>3</m:mn>
    <m:mn>4</m:mn>
  </m:mfrac>
</m:math>.  The probability that Alissa catches Muddy coming out of the third door is <m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>2</m:mn>
  </m:mfrac>
</m:math> and the probability she does not catch Muddy is <m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>2</m:mn>
  </m:mfrac>
</m:math>.  It is equally likely that Muddy will choose any of the three doors so the probability of choosing each door is <m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>3</m:mn>
  </m:mfrac>
</m:math>.
</para>
<table id="element-666">
<name>Door Choice</name>
<tgroup cols="5"><thead>
  <row>
    <entry>Caught or Not</entry>
    <entry>Door One</entry>
    <entry>Door Two</entry>
    <entry>Door Three</entry>
    <entry>Total</entry>
  </row>
</thead>
<tbody>
  <row>
       <entry>Caught</entry> 
   <entry><m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>15</m:mn>
  </m:mfrac>
  <m:mtext/>
</m:math></entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>12</m:mn>
  </m:mfrac>
  <m:mtext/>
</m:math></entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>6</m:mn>
  </m:mfrac>
  <m:mtext/>
</m:math></entry>
    <entry>____</entry>
  </row>
  <row>
    <entry>Not Caught</entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>4</m:mn>
    <m:mn>15</m:mn>
  </m:mfrac>
</m:math></entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>3</m:mn>
    <m:mn>12</m:mn>
  </m:mfrac>
</m:math></entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>6</m:mn>
  </m:mfrac>
</m:math></entry>
    <entry>____</entry>
  </row>
  <row>
    <entry>Total</entry>
    <entry>____</entry>
    <entry>____</entry>
    <entry>____</entry>
    <entry>1</entry>
  </row>
</tbody>
</tgroup>
</table>


<list id="element-791" type="bulleted"><item>The first entry <m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>15</m:mn>
  </m:mfrac>
<m:mo> =</m:mo> <m:mo>(</m:mo>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>4</m:mn>
  </m:mfrac>
<m:mo>)</m:mo>
<m:mo>(</m:mo>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>3</m:mn>
  </m:mfrac>
<m:mo>)</m:mo></m:math> is <m:math><m:mtext>P(Door One AND Caught)</m:mtext></m:math>.</item>


<item>The entry
 <m:math><m:mfrac>
    <m:mn>4</m:mn>
    <m:mn>15</m:mn>
  </m:mfrac>
 <m:mo>=</m:mo> <m:mo>(</m:mo>
 <m:mfrac>
    <m:mn>4</m:mn>
    <m:mn>5</m:mn>
  </m:mfrac>
<m:mo>)</m:mo><m:mo>(</m:mo>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>3</m:mn>
  </m:mfrac>
<m:mo>)</m:mo></m:math> is <m:math><m:mtext>P(Door One AND Not Caught)</m:mtext></m:math>.</item>

</list><para id="element-94">Verify the remaining entries.</para><exercise id="element-919"><?solution_in_back?>
<problem>
  <para id="element-910">Complete the probability contingency table.  Calculate the entries for the totals.  Verify that the lower-right corner entry is 1.
  </para>
</problem>

<solution>
<table id="element-6166">
<name>Door Choice</name>
<tgroup cols="5"><thead>
  <row>
    <entry>Caught or Not</entry>
    <entry>Door One</entry>
    <entry>Door Two</entry>
    <entry>Door Three</entry>
    <entry>Total</entry>
  </row>
</thead>
<tbody>
  <row>
       <entry>Caught</entry> 
   <entry><m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>15</m:mn>
  </m:mfrac>
  <m:mtext/>
</m:math></entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>12</m:mn>
  </m:mfrac>
  <m:mtext/>
</m:math></entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>6</m:mn>
  </m:mfrac>
  <m:mtext/>
</m:math></entry>
    <entry><emphasis><m:math><m:mfrac><m:mn>19</m:mn><m:mn>60</m:mn></m:mfrac></m:math></emphasis></entry>
  </row>
  <row>
    <entry>Not Caught</entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>4</m:mn>
    <m:mn>15</m:mn>
  </m:mfrac>
</m:math></entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>3</m:mn>
    <m:mn>12</m:mn>
  </m:mfrac>
</m:math></entry>
    <entry><m:math>
 <m:mfrac>
    <m:mn>1</m:mn>
    <m:mn>6</m:mn>
  </m:mfrac>
</m:math></entry>
    <entry><emphasis><m:math><m:mfrac><m:mn>31</m:mn><m:mn>60</m:mn></m:mfrac></m:math></emphasis></entry>
  </row>
  <row>
    <entry>Total</entry>
    <entry><emphasis><m:math><m:mfrac><m:mn>5</m:mn><m:mn>15</m:mn></m:mfrac></m:math></emphasis></entry>
    <entry><emphasis><m:math><m:mfrac><m:mn>4</m:mn><m:mn>12</m:mn></m:mfrac></m:math></emphasis></entry>
    <entry><emphasis><m:math><m:mfrac><m:mn>2</m:mn><m:mn>6</m:mn></m:mfrac></m:math></emphasis></entry>
    <entry>1</entry>
  </row>
</tbody>
</tgroup>
</table>
</solution>
</exercise><exercise id="element-604"><problem>
  <para id="element-117">
     	What is the probability that Alissa does not catch Muddy?
  </para>
</problem>

<solution>
  <para id="element-70">
    <m:math><m:mfrac><m:mn>41</m:mn><m:mn>60</m:mn></m:mfrac></m:math>
  </para>
</solution>
</exercise>

<exercise id="element-288"><problem>
  <para id="element-45">
       	 What is the probability that Muddy chooses Door One <emphasis>OR</emphasis> Door Two given that Muddy is caught by Alissa?
  </para>
</problem>

<solution>
  <para id="element-63"><m:math><m:mfrac><m:mn>9</m:mn><m:mn>19</m:mn></m:mfrac></m:math></para>
</solution>
</exercise>

<note>You could also do this problem by using a probability tree.  See the <cnxn document="m16846">Tree Diagrams (Optional)</cnxn> section of this chapter for examples.</note>
</example>   
  </content>
  <glossary>
 <definition id="contintable">
    <term>Contingency Table</term>
    <meaning>
 The method of displaying a frequency distribution in case of dependable (contingent) variables; the table provides the easy way to calculate conditional probabilities.
    </meaning>
  </definition>
</glossary>
</document>
