CHAPTER 1



computing probabilities from Frequencies

PURPOSE: In this laboratory, you will learn how to compute frequencies from raw data, generate a frequency distribution, compute expected probabilities and compare them to observed proportions, and compute expected frequency distributions compare them to observed frequency distributions.

MATERIALS NEEDED: 1 Coin per student

1 ORGANIZING DATA INTO GROUPS AND DETERMINING FREQUENCIES

1 Discrete Data

Assume that you asked 26 people to rank a product using a scale of 1 to 10. You collected the following data:

10, 8, 4, 5, 3, 5, 1, 9, 8, 2, 6, 3, 8, 7, 5, 3, 8, 5, 5, 10, 2, 8, 6, 3, 5, 7

The measured variable in this experiment was Product Scale. Each of theses values is called an observation and, mathematically, each is referred to as a “Y”. We want to know the most common rating for our product.

1 Make classes:

1) Start by identifying the highest Y and the lowest Y. In this example, the lowest Y is 1 and the highest is 10.

2) Create classes for all values of Y in that range. So, our classes would be 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. Put them in the first column of Table 1-1.

3) Now, going through your unordered data ONE observation at a time, put a hash mark in the second column that corresponds to the class with the correct value. Then cross out the value in the data list. Our first value is 10, so put a hash mark in the last row and then cross off the 10 in the list.

Table 1- 1: Frequency Table

|Classes (Y) |Hash Mark (e.g. ) |Observed Frequency |

|1 | | |

|2 | | |

|3 | | |

|4 | | |

|5 | | |

|6 | | |

|7 | | |

|8 | | |

|9 | | |

|10 |[pic] | |

When you are through, the Table 1-1 should look like this:

Table 1- 2: Frequency Table for Data from Table 1-1 tallied with hashmarks.

|Classes (Y) |Hash Mark (e.g. ) |Observed Frequency |

|1 |[pic] | |

|2 |[pic][pic] | |

|3 |[pic][pic][pic][pic] | |

|4 |[pic] | |

|5 |[pic][pic][pic][pic] [pic] | |

|6 |[pic][pic] | |

|7 |[pic][pic] | |

|8 |[pic][pic][pic][pic] | |

|9 |[pic] | |

|10 |[pic][pic] | |

4) Count the hash marks for each class and record the total in the Observed Frequency column.

2 Reorganizing Classes

There are times when you need to reorganize discrete data to make fewer classes of Y. For example, let’s assume that we wanted to use five classes for the data in Table 1-2. The first class would contain 1s and 2s, the second class would contain 3s and 4s etc. The smallest possible value and the largest possible value in a class are referred to as the Class Limits; for example the lower class limit for the first class is 1 and the upper class limit is 2. The new value for Y is now the midpoint of the class and is called the Class Mark; the class mark for the 1st class is 1.5 etc. (Table 1-3).

The main rules for creating classes is:

1) The class limits must be unique for each class. For example, if the class limits for the first class were 1 and 2, the next class could not be 2-3.

2) The range for all classes should be the same.

Table 1- 3: Frequency Table for regrouped classes from Table 1-2.

|Classes |Class Mark (Y) |Observed Frequency |

|1-2 |1.5 |3 |

|3-4 |3.5 |5 |

|5-6 |5.5 |8 |

|7-8 |7.5 |7 |

|9-10 |8.5 |3 |

2 Continuous Data

The same rules apply for continuous data. An easy way to group continuous data is to use the stem and leaf method. The leaf is the last decimal place of your data and the stem is the remainder. For example, assume you have collected the following data:

1.1, 5.5, 5.4, 3.9, 1.4, 4.3, 5.6, 6.7, 5.2, 3.3, 2.1, 5.9, 4.7, 2.4, 7.3, 2.8, 3.2, 4.4.

1) In this case, the data have only one decimal place so tenths will become the leaves (0.1 to 0.9). The stem will be the remainder, the units.

2) Use the stem values to make classes. Find the lowest and highest value: 1.1, 7.3 so the lowest stem value is 1 and the highest stem value is 7.

3) As before, go through the observations one at a time but, instead of hash marks, record the value as a leaf. The leaf for the first value (1.1) would be recorded in the 1st row as 1, the leaf for the second value (5.5) would be recorded in the 5th row as 5, and the leaf for the third value (5.4) would also be recorded in the 5th row as 4, etc (Table 1-4).

4) Count the values for each class and enter the count in the Observed Frequency column (Table 1-4).

Table 1- 4: Using the Stem and Leaf method to create classes for continuous data.

|Class - Stem |Leaves 0.1 To 0.9 |Observed Frequency |

|1 |1 | |

|2 | | |

|3 | | |

|4 | | |

|5 |5, 4 | |

|6 | | |

|7 | | |

| |TOTAL |18 |

5) Now determine class marks for the classes and you are through. For the first class, the lower class limit is 1.0 and the upper class limit is 1.9. The midpoint for the first class is (1.0+1.9)/2=1.45 so the class mark (Y) is 1.45. The final result is shown in Table 1-5.

Table 1- 5: Frequency table for continuous data

|Class Limits |Class Mark (Y) |Observed Frequency |

|1.0 – 1.9 |1.45 |2 |

|2.0 – 2.9 |2.45 |3 |

|3.0 – 3.9 |3.45 |3 |

|4.0 – 4.9 |4.45 |3 |

|5.0 – 5.9 |5.45 |5 |

|6.0 – 6.9 |6.45 |1 |

|7.0 – 7.9 |7.45 |1 |

| |TOTAL |18 |

2 Practice:

1 Create a Frequency distribution from the following data:

5, 4, 3, 7, 5, 9, 4, 2, 7, 3, 5, 0, 3, 6, 10, 4, 8, 4, 1, 6

Table 1- 6: Frequency Table

|Classes |Hash Mark (e.g. ) |Observed Frequency |

|(Y) | | |

| | | |

| | | |

| | | |

| | | |

| | | |

| | | |

| | | |

| | | |

| | | |

| | | |

| | | |

2 Create a Frequency distribution from the following data:

16.6, 12.0, 16.4, 18.4, 14.0, 14.9, 16.9, 14.2, 20.0, 13.5, 14.5, 13.7, 15.4, 16.2, 13.1, 11.0, 13.5, 18.3, 17.1, 15.8

Table 1- 7: Using the Stem and Leaf method to create classes for continuous data.

|Class - Stem |Leaves |Class Limits |Class Mark |Observed Frequency |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | |TOTAL | |

3 COMPUTING PROBABILITIES

4 EXERCISE 1: 1 COIN FLIPS – 1 COIN AT A TIME

We will be trying to determine the probability and the expected number (frequency) of heads and expected number of tails if we flip a coin 20 times.

1 Determine Probabilities for single events (i.e. one coin only)

For each coin, there are only two possibilities and they are equal if the coin is not weighted. So the probability of getting a Heads = ½ or 0.5. The probability of getting a Tails should also be ½ or 0.5.

2 Determine Expected Frequencies for single events

The Expected Frequency can be computed from the probabilities: Expected Frequency ([pic]) = Probability*Total frequency (∑f). For this experiment, total frequency (∑f) is the total number of coin flips = ________. Fill in the Table 1-8.

Table 1- 8: Expected Frequencies for a single coin tossed twenty times.

|Result (Y) |Probability |Expected Frequency ([pic]) |

|Heads | | |

|Tails | | |

|TOTAL | | |

3 Collect data – Observed Frequencies of flipping a coin 20 times

We will work in groups of two. One of the people in the group will flip the coin and the other will record. Flip the coin 20 times. For each coin toss, record (with a hash mark in Table 1-9) whether the result (Y) was Heads or Tails. After you have completed all of the flips, put the total number of occurrences in the Observed Frequency (F) column.

Table 1- 9: Results of flipping a single coin twenty times

|Result (Y) |Hash Mark (e.g. ) |Observed Frequency (F) |

|Heads | | |

|Tails | | |

| |TOTAL (∑f) |20 |

4

5 Compare Observed Frequencies to Expected Frequencies.

Fill in Table 1-10.

Table 1- 10: Comparison of Observed and Expected Frequencies for a single coin tossed 20 times

|Result (Y) |Expected Frequency ([pic]) |Observed Frequency (F) |

|Heads | | |

|Tails | | |

|TOTAL | | |

Do they match exactly?

Are they close?

6 Conclusions

What do your results tell you?

7 What if?

Assume that your Observed Frequencies were: Heads 5 and Tails 25.

What would you conclude?

What possible explanations might there be for these results?

5 EXERCISE 2: 2 COIN FLIPS – 2 COINS AT A TIME

In this case, we want to determine the probability and expected frequencies for obtaining Heads and Heads, Heads and Tails or Tails and Tails if we flip 2 coins simultaneously 20 times.

1 Determine probabilities for single events (i.e. one coin only)

As before, the probability of getting a Heads = 0.5 and the probability of getting a tails should be 0.5.

2 Compute the probabilities for joint events (2 coins at a time, k=2).

6

T

1 Heads-Heads

The probability of person 1 getting Heads AND person 2 getting Heads.

P1Heads * P2Heads = PHeads&Heads 0.5 * 0.5 = 0.25 = PHeads&Heads

2 Heads-Tails

The probability of a person getting Heads AND a person getting Tails is equal to the probability of person 1 getting Heads AND person 2 getting Tails OR person 1 getting Tails AND person 2 getting Heads.

(P1Heads * P2Tails) + (P1Tails * P2Heads) = PHeads&Tails

(0.5*0.5) + (0.5*0.5) = 0.50 = PHeads&Tails

3 Tails-Tails

The probability of person 1 getting Tails AND person 2 getting Tails.

P1Tails * P2Tails = PTails&Tails 0.5 * 0.5 = 0.25 = PTails&Tails

2 Determine Expected Frequencies for joint events

The Expected Frequency ([pic]) can be computed from the Probabilities: Expected Frequency ([pic]) = Probability*Total frequency (∑f).

For this experiment, total frequency (∑f) was ____.

Fill in Table 1-11.

Table 1- 11: Expected Frequencies for two coins tossed 20 times.

|Result (Y) |Probability |Expected Frequency ([pic]) |

|Heads&Heads | | |

|Heads&Tails | | |

|Tails&Tails | | |

|TOTAL |1.00 | |

3 Collect data – Observed Frequencies of flipping two coins simultaneously (k=2) 20 times

We will work in groups of two. Each of you will be responsible for flipping one coin. Both people in a group will flip their coins at the same time and each group will make 20 coin flips. For each coin toss, record (with a hash mark in Table 1-12) whether the result was Heads&Heads, Heads&Tails or Tails&Tails. After you have completed all of the flips, put the total number of occurrences in the Observed Frequency column.

Table 1- 12: Results of flipping two coins simultaneously twenty times

|Result (Y) |Hash Mark (e.g. ) |Observed Frequency (F) |

|Heads&Heads | | |

|Heads&Tails | | |

|Tails&Tails | | |

| |TOTAL(∑f) |30 |

4 Compare Observed Frequencies to Expected Frequencies.

Fill in Table 1-13.

Table 1- 13: Comparison of Observed and Expected Frequencies for two coins tossed thirty times.

|Result (Y) |Expected Frequency ([pic]) |Observed Frequency (F) |

|Heads & Heads | | |

|Heads & Tails | | |

|Tails & Tails | | |

Use Excel™ or Systat™ to create a bar chart comparing Observed and Expected Frequencies for the three possible results. If you are using Excel™:

• Highlight all 12 cells.

• Click on the chart icon on the toolbar.

• Select a Column type chart and then proceed through the rest of the selections.

• Print the chart and past in the space provide on the next page:

1 Paste Chart: Chart of Observed Frequency versus Expected Frequency for Two Coin Toss.

5 Conclusions

What do your results tell you?

6 What if?

Assume that your observed frequencies were Heads&Heads = 1, Heads&Tails = 8, Tails&Tails = 11

What would you conclude?

What possible explanations might there be for these results?

7 EXERCISE 4: Red or Blue marble – 3 PEOPLE AT A TIME (k=3).

Each of you will be given a marble that is red or blue. Let’s assume that, if you have a red marble, you have a disease. We will be examining three people at a time to see if there is a pattern to the disease; the type of pattern or lack of a pattern will give use some idea of how it might be spread.

For this experiment, we are going to introduce two different issues. First will be how to determine probabilities of individual events (need to know these to compute joint events) from your data. Second, we will look at how to determine probabilities (what is expected by chance) of encountering none, one two or three ill people in samples of three (people).

1 Collect data – Observed Frequencies of sampling three people at a time (k=3).

In this case, because of the limited number of students in lab, we will end up sampling the same people more than once. Normally, you would make sure that each sample was independent of the others. For the purpose of this exercise, we will assume that the samples are independent even though we know that it is not true in this case. Select two other students who are fairly near to you and compare marbles. We will then record the results on the blackboard. After the results are recorded, select two more people, hopefully not the same ones but they must be physically close to you. We will repeat this five times. When we are through, enter the data in Table 1-14:

Table 1- 14: Results of sampling three people (k=3) at a time.

|Result (Number of Ill People in |Hash Mark (e.g. ) |Observed Frequency (f) |

|Group of Three) (Y) | | |

|0 | | |

|1 | | |

|2 | | |

|3 | | |

| |TOTAL NUMBER OF SAMPLES (∑f) | |

2 Determine probabilities for single events (one person is ill or not).

With the coins, we knew what the probability of flipping a coin would be but, in this case, we do not know the probability of any one person being ill. We will need to figure it out from our data. We need to know: how many people were ill and how many people (not samples) were sampled. To figure out how many ill people were sampled, we will compute the number of ill people for each type of result; then we will add them together. The number of ill people for any type of result is the number of ill people in the result (Y) time the observed frequency (f). To figure out how many people were sampled (T), we will multiply the sample size (k=3)*the total number of samples taken (∑f). Fill in Table 1-13.

Table 1- 13: Computing the number of ill people ∑(f*Y)

|Number of ill people out of three|Observed frequency (f) |Number of ill people (f*Y) |

|(Y) | | |

|0 | |0 |

|1 | | |

|2 | | |

|3 | | |

| |Total ill = Σ(f*Y) = | |

The total number of people sampled = k*(∑f) =

The probability of encountering one ill person (p), sampling one at a time = Σ(f*Y)/(k*∑f).

p =

The probability of encountering a person who is not ill (q), sampling one at a time is equal to 1- p.

q =

3 Compute the probabilities for joint events (3 people at a time).

1 0 ill out of three

The probability of person 1 being ok AND person 2 being ok AND person 3 being ok is:

Prob (0 ill) = q*q*q = q3

Prob (0 ill) =

2 1 ill out of three

There are three possible ways to get 1 person ill out of three:

|Person 1 |Person 2 |Person 3 |

|Ill |Ok |Ok |

| |OR | |

|Ok |Ill |Ok |

| |OR | |

|Ok |Ok |Ill |

So the probability of one person out of three being ill is:

Prob (1 ill) = p*q*q + q*p*q + q*q*p = p*q*q + p*q*q + p*q*q = 3*p*q*q = 3pq2

Prob (1 ill) =

3 2 ill out of three

There are three possible ways to get 2 persons ill out of three:

|Person 1 |Person 2 |Person 3 |

|Ill |Ill |Ok |

| |OR | |

|Ok |Ill |Ill |

| |OR | |

|Ill |Ok |Ill |

So the probability of one person out of three being ill is:

Prob (2 ill) = p*p*q + q*p*p + p*q*p = p*q\*q + p*p*q + p*p*q = 3*p*p*q = 3p2q

Prob (2 ill) =

4 3 ill out of three

The probability of person 1 being ill AND person 2 being ill AND person 3 being ill is:

Prob (3 ill) = p*p*p = p3

Prob (3 ill) =

4 Determine Expected Frequencies for joint events

The Expected Frequency ([pic]) can be computed from the Probabilities: Expected Frequency = Probability*Total frequency (∑f). For this experiment, total frequency (of samples, not people) was ____. Fill in Table 1-14.

Table 1- 14: Expected Frequencies for number of ill people in a sample of three.

|Result (Number Ill Out of Three) (Y) |Probability |Expected Frequency ([pic]) |

|0 |1 p0q3= | |

|1 |3 p1q2= | |

|2 |3 p2q1= | |

|3 |1 p3q0= | |

|TOTAL | | |

5 Compare Observed Frequencies to Expected Frequencies.

Fill in Table 1-15.

Table 1- 15: Comparison of Observed and Expected Frequencies for number of ill people in a sample of three.

|Result (Number Ill Out of Three) (Y) |Expected Frequency ([pic]) |Observed Frequency (f) |

|0 | | |

|1 | | |

|2 | | |

|3 | | |

1

2 Use Excel™ or Systat™ to create a char of the Observed Number of Ill People versus the Expected Number of Ill People in Samples of Three. Paste the chart below.

3 Chart of Observed Number of Ill People versus Expected Number of Ill People in Samples of 3.

6 Conclusions

What do your results tell you?

What possible explanations might there be for these results?

-----------------------

Rules:

1) AND rule: If two (or more) events have to occur simultaneously, MULTIPLY the individual event probabilities to compute the joint probability. The probability of A and B is equal to the probability of A times the probability of B.

2) OR rule: If eit„H[pic]—H[pic]×H[pic]àH[pic]éH[pic]òH[pic]óH[pic]÷H[pic]úH[pic]ýH[pic]ý[pic]@&„¸[?]û[pic]@&x¾[?]ò[pic]Cx¾[?]ì[pic]Cx¾[?]ì[pic]Cx¾[?]g èò[pic]Cx¾[?]ò[pic]Cx¾[?]ò[pic]Cx¾[?]her of the events can occur then ADD the individual probabilities to compute the joint probability. The probability of A or B is equal to the probability of A PLUS the probability of B.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download