Introducing Probability

  • Upload
    1ab4c

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

  • 7/28/2019 Introducing Probability

    1/13

    Chapter 10. Introducing Probability

    Topics Covered in this chapter:

    Simulations Continuous Probabilities and Normal Probabilities

    Simulations

    Example 10.3: Some coin tossers

    The Problem: The French naturalist Count Buffon tossed a coin 4040 times. The

    result was 2048 heads or 2048/4040 =.5069 for heads. Suppose, like Buffon, youwould like to flip a coin 4040 times. This can be simulated using SPSS.

    1. Set up the variables to simulate the coin tosses.a. Go toVariable View.b. Under Name in row 1, type heads, corresponding to the total

    number of heads flipped.c. Under Name in row 2, type proportion, corresponding to the

    proportion of coin tosses that result in heads.d. Forproportion, increase the number of decimals to 4.

    2. Simulate the process of 4040 coin tosses:a. Click onData View.b. Enter the number 1 in the first entry. This will allow SPSS to run a

    process.

    c. Click onTransform thenCompute Variable.d. UnderTarget Variable, type heads.e. Under Function group, selectRandom Numbers.f. Under Functions and Special Variables, double-click onRV.Binom.

    80

  • 7/28/2019 Introducing Probability

    2/13

    Chapter 1081

    g. Type in 4040 for the first question mark (the number of trials). Inthe place of the second question mark, type in 0.5 for the probabilityof a success (the probability of flipping a head).

    h.

    Click theOKbutton.i. You will be askedChange existing variable? ClickOK.j. The number of heads flipped will be shown in theData Editor.

  • 7/28/2019 Introducing Probability

    3/13

    Introducing Probability 82

    3. Find the proportion of heads flipped in the 4040 trials.a. Click onTransform thenCompute Variable.b. In theTarget Variablebox, type proportion.c. In the box below, click onheads, then hit the arrow to the right of the

    box. This will placeheads in theNumeric Expression.d. Using the numeric function buttons, type /4040. This will divide the

    number of heads by 4040, giving the proportion of heads flipped.

    e. ClickOK.f. Change existing variable? ClickOK.

  • 7/28/2019 Introducing Probability

    4/13

    Chapter 1083

    The result shows up in theData Editor window. In this case, the proportion ofheads was 0.499. If the same simulation was run again, different values wouldresult due to the randomness of the distribution.

    Example 10.5: Rolling dice and counting the spots

    The Problem: Gamblers care only about the total number of spots on the up-faces of the dice. Simulate 100 rolls of two dice and look at the frequency of thetotal number of spots showing on the total value.

    1. Steps to simulate two dice rolled simultaneously 100 times:a. Click onVariable View.b. Under Name in row 1, typedie1, corresponding to the number of spots

    showing on the first die.

    c. Under Name in row 2, typedie2, corresponding to the number of spotsshowing on the second die.d. Under Name in row 3, typetotal, corresponding to the number of

    combined spots on the two dice.e. Under Decimals, change the 2 in each row to a 0.

    f. Click onData View.g. Scroll down, then hit enter until line 100 appears.h. Enter the number 1 in the first column of row 100. Entering a value

    in row 100 tells SPSS that an experiment with 100 trials will be

    conducted.

  • 7/28/2019 Introducing Probability

    5/13

    Introducing Probability 84

    2. Randomize the number of spots for each die.a. Click onTransform thenCompute Variable.b. UnderTarget Variable, type die1.c. Under Function group, click onArithmetic.d. Under Functions and Special Variables, double-click onTrunc.e. Under Function group, selectRandom Numbers.f. Under Functions and Special Variables, double-click on

    Rv.Uniform.g. For the bounds, use 1 and 7.

  • 7/28/2019 Introducing Probability

    6/13

    Chapter 1085

    Now, a number from a uniform distribution between 1 and 7 will be randomlygenerated for each of the 100 cases. Using theTruncprocedure will give us justthe integer value. For example, a random uniform number of 4.27881 will yield a

    roll of a 4 for that case.

    h. Click theOKbutton.i. You will be askedChange existing variable? ClickOK.j. Repeat this process fordie2.

    3. Sum the results fromdie1anddie2.a. Click onTransform thenCompute Variable.b. UnderTarget Variable, type total.c. In the box below, click ondie1, then hit the arrow to the right of the

    box. This will placedie1 in theNumeric Expression.d. Click on the + button.e. Click ondie2, then hit the arrow to the right of the box. TheNumericExpression will now read die1 +die2.

    f. Click theOKbutton.g. You will be askedChange existing variable? ClickOK.

    Now the third column of data for total will equal the sum ofdie1anddie2.

  • 7/28/2019 Introducing Probability

    7/13

    Introducing Probability 86

    4. Analyze the frequencies of total sums of spots on the two dice when rolledsimultaneously.a. Click onAnalyze.b. Select Descriptive Statistics.c. Select Frequencies.d. On the left-hand side, click on total, since we are interested in the total

    number of spots, not those of an individual dice.e. Click on the arrow pointing right. This will placetotal in the

    Variable(s)box.

    f. ClickOK.SPSS viewer will provide the following page with the frequency distribution of

    the sample space S ={2,3,4,5,6,7,8,9,10,11,12}.

  • 7/28/2019 Introducing Probability

    8/13

    Chapter 1087

    5. Produce a graphical summary of the data.a. Click onGraphs.b. Scroll toLegacy Dialogand selectBar.c. Click onSimple.

    d. Click onDefine.

  • 7/28/2019 Introducing Probability

    9/13

    Introducing Probability 88

    e. On the left-hand side, choosetotal.f. Click on the arrow pointing right that is next to theCategory Axis

    box. This will placetotal in theCategory Axisbox.g. ClickOK.

    Continuous Probabilities and Normal Probabilities

    Example 10.9: The heights of young women

    The Problem: What is the probability that a randomly chosen young woman hasa height between 68 and 70 inches? The heights of women are normallydistributed with a mean of 64 inches and a standard deviation of 2.7 inches.

    1. Steps to finding the probability in the example.a. Click onVariable View.b. Label rows 1-3 as lower,upper, andprobability.c. Change the number of decimals for probabilityto four.

  • 7/28/2019 Introducing Probability

    10/13

    Chapter 1089

    d. Click onData View.e. Enter the values 68 and 70 in thelower andupper columns. The

    names lower andupper refer to the bounds that the height must bebetween.

    2. Computing the probability.a. Click onTransform.b. ChooseCompute Variable.c. UnderTarget Variable, type probability.d. For Numeric Expression, chooseFunction Group.e. ChooseCDF & Noncentral CDF.f. Double-click onCdf.Normal.g. For the bounds, selectupper, type64, type2.7.h. Choose the button.i. Repeat steps e through g, except select lower instead ofupper.

  • 7/28/2019 Introducing Probability

    11/13

    Introducing Probability 90

    j. HitOK.k. Change existing variable? ClickOKagain.

    The correct probability of .0561 appears.

    Chapter 10 Exercises

    10.47 Birth order.10.51 Did you vote?

  • 7/28/2019 Introducing Probability

    12/13

    Chapter 10 SPSS Solutions

    10.47 The possible arrangements are: BBB, GGG, BGG, GBG, GGB, BBG, BGB, GBB.

    If all arrangements are equally likely, 3 of the eight arrangements have two girls, so the

    probability of two girls becomes 3/8 = 0.375. To find the probability distribution for the

    number of girls, we can see that one arrangement results in 0 or 3 girls, so P(X= 0) = P(X

    = 3) = 1/8. Similarly, there are also three arrangements that lead to one girl (two boys),

    so P(X = 1) = 3/8. Well learn in Chapter 12 that this random variable is Binomial. We

    can create the probability distribution for this

    variable by entering values 0 through 3 in a

    column of the worksheet we have named

    Girls and using Transform, Compute

    Variable to find the probabilities as shown

    below.

    10.51 We use Transform, Compute Variable to find the probability of between 52%

    and 60% of respondents claiming to have voted as shown below.

    372

  • 7/28/2019 Introducing Probability

    13/13

    Similarly, we find the probability of at least 72% voting by subtracting the cumulative

    probability from 1. This is (to four decimal places) 0.

    373