Lab 4 Probability
Factorial
Consider the problem:
A history pop quiz has one question in which students are asked to arrange the following presidents in chronological order: Hayes, Taft, Polk, Taylor, Grant, Pierce. If an unprepared student makes random guesses, what is the probability of selecting the correct chronological order?
The factorial rule tells us that six different items have 6! different possible rearrangements.
6!=6×5×4×3×2×1=720
Because only one of the 720 possible arrangements is correct, the probability of getting the correct chronological order with random guessing is 1/720, or 0.00139. With such a low probability, it is highly unlikely that a student will get the correct answer with random guessing.
Now we will work this problem using Excel:
At the top of the screen, click FORMULAS.
Select the Math & Trig category. Select the FACT function.
Complete the dialog box as shown below. Click OK.
Excel’s FACT function returns 720. To find the solution to the problem presented in the problem, you divide 1 by 720: 1/720 = 0.00139
Permutations
Consider the problem:
In horse racing, a bet on an exacta in a race is won by correctly selecting the horses that finish first and second, and you must select those two horses in the correct or-der. The 136th running of the Kentucky Derby had a field of 20 horses. If a bettor randomly selects two of those horses for an exacta bet, what is the probability of winning by selecting Super Saver to win and Ice Box to finish second (as they did)? Do all of the different possible exacta bets have the same chance of winning?
We have n = 20 horses available, and we must select r = 2 of them without replacement. The number of different sequences of arrangements is found as shown:
???=?!(???)!=20!(20?2)!=20!18!=380
There are 380 different possible arrangements of 2 horses selected from the 20 that are available. If one of those arrangements is randomly selected, there is a probability of 1/380 that the winning arrangement is selected. There are 380 different possible exacta bets, but not all of them have the same chance of winning, because some horses tend to be faster than others. (A correct $2 exacta bet in this race won $152.40.)
In Excel:
At the top of the screen, click FORMULAS.
Select More Functions then the Statistical category. Select the PERMUT function.
Complete the dialog box as shown. A description of the entries immediately follows the dialog box.
Number: Enter the total number of items. For this problem, the total is 20.
Number_chosen: Enter the number of items in each permutation. For this problem, there are 2 numbers in each permutation.
Click OK. Excel’s PERMUT function returns 380. The probability of randomly selecting the winning arrangement is 1/380 = 0.00263
Combinations
Consider the problem:
In the Pennsylvania Match 6 Lotto, winning the jackpot requires that you select six different numbers from 1 to 49, and the same six numbers must be drawn in the lottery. The winning numbers can be drawn in any order, so order does not make a difference. Find the probability of winning the jackpot when one ticket is purchased.
We have 49 different numbers and we must select 6 without replacement (because the selected numbers must be different). Because order does not count, we need to find the number of different possible combinations. With n = 49 numbers avail-able and r = 6 numbers selected, the number of combinations is as shown below:
???=?!(???)!?!=49!(49?6)!?6!=49!43!?6!=13.983,816
If you select one 6-number combination, your probability of winning is 1>13,983,816. Typical lotteries rely on the fact that people rarely know the value of this probability and have no realistic sense for how small that probability is. This is why the lottery is sometimes called a “tax on people who are bad at math.”
In Excel:
At the top of the screen, click FORMULAS.
Select the Math & Trig category. Select the COMBIN function.
Complete the dialog box as shown at the top of the next page. A description of the entries immediately follows the dialog box.
Number: Enter the total number of items. For this problem, the total is 49.
Number_chosen: Enter the number of items in each combination. For this problem, there are 6 numbers in each combination.
Click OK. The function returns 13,983,816 combinations. The probability of winning the jackpot is 1/13,983,816 = 7.15112E-08. Because the probability is so small, it is displayed in scientific notation.
The Birthday Problem
The classic birthday problem asks you to find the probability that among 25 randomly selected people at least two have the same birthday. Let’s us first look at the analytical solution. Analytical in this context means, using math.
We have a group of 25 people. Calculating the probability of birthdays in common is actually rather difficult. But there is an easier way. We are asking the question, what is the probability of at least two people in a group of 25 share a common birthday? What is the opposite question? What is the probability that no one in the group of 25 shares a common birthday? This is the complement of at least two share a birthday. We can calculate the probability of no one sharing a birthday.
Begin by considering a single person. Using just a 365 day year and ignoring leap years, there are 365 possible days for the first person to have a birthday. The probability is:
365365=1
What about the second person. The second person cannot share a birthday with the first. That means there are only 364 days available. The probability of not having a birthday is common is:
- 365365?364365=0.9973
What about the third person. There are now two days unavailable. Using the fundamental counting principle, multiply.
- 365365?364365?363365=0.9918
For four people
365365?364365?363365?362365=0.9836
If we extend this to 25 people we get
365365?364365?363365?…?341365=0.4313
This is the probability that no one shares a birthday. But we are looking for the complement, at least two people share a birthday. we get this as
- 1?0.4313=0.5687
The probability that at least two people in a group of 25 share a birthday is 0.5687, about 60% chance.
We can write this in our permutation notation above as:
1?365??365?
However, this involves very large numbers and Excel, and most calculators, cannot handle such values.
- This graph shows the probability versus the number of people. At 23 people, the probability is around 50%. So there is a 50-50 chance that a group of 23 at least two people will share a birthday. At 50 people, the probability is an almost certain 95%.
Birthday problem simulation
You will be performing a numerical simulation, using Excel, to verify these results.
You will be generating the samples using Excel’s RANDBETWEEN function. The RANDBETWEEN function will randomly generate birthdays equivalent to having 25 randomly selected people in a room. To perform the simulation follow the following steps.
Open a new Excel worksheet and click in cell A1.
At the top of the screen, click FORMULAS.
Select the Math & Trig category. Select the RANDBETWEEN function.
In the dialog box, enter 1 for the Bottom and 365 for the Top as shown. Click OK.
Copy the contents of cell A1 to A2:A25. The first few rows of my output are shown below. Your output will not be the same as mine because the numbers were generated randomly. You will notice that the number originally displayed in A1 changed after you executed the copy. This occurred because cell A1 contains the RANDBETWEEN function rather than a numerical value. If you click in any cell in the range A1:A25, you will see that the formula bar displays =RANDBETWEEN(1,365).
VERY IMPORTANT STEP. You will now use column A as a template. To do this, first click and drag over the cells from A1 to A25 to select the 25 randomly generated numbers. Left click on cell B1 then right-click and select Paste Special. In the dialog box, select Values. Click OK. This copies the values of the random number generator and not the formula used to create the numbers.
The RANDBETWEEN function in the cells B1:B25 has now contain numerical values that will not change. You may have noticed that the values in cells A1:A25 did change, that is okay and expected. Sort the values in B1:B25 to see if there are any repetitions. Select Column B. Then Data then Sort. You may get a message of Sort Warning, “Microsoft Excel found data next to your selection, Since you have not selected this data, it will not be sorted.” Simple select “Continue with current selection” and click “Sort…”
Column B should be selected Smallest to Largest as shown. Click OK.
Visually inspect column B only, to see of there any repetitions, this represents two or more people having the same birthday. My sample, shown above, did not have any repetitions. In Cell B27 simply answer Yes if there are any repeats or No if there are no repeats. Answer Yes even if there are more than two matches.
Repeat the copying procedure 9 more times, copying the values of column A into columns C, D, all the way to column K.
Sort each column separately, following the procedure for Column B. For the rest of the simulation, ignore column A. It will continue to change as you do the remaining operations. We don’t want our values to change.
For each column (starting with B) see if there are any repeats and in cells B27, C27, … up to K27, enter Yes if there are any repeats at all in that column and No if there are no repeats. You only need one Yes or No per column.
The probability of two or more people in a group of 25 share the same birthday is the number of times you entered Yes divided by 10.
You are now going to produce a report of what you did. Imagine explaining the problem to your Grandmother who knows nothing about statistics or Excel. Use plain language. Address the following questions:
What is the probability of two or more people in a group of 25 having the same birthday? Keep in mind, your Grandmother may not believe you so explain your results.
How could you improve the simulation?
What would you do if you where asked to find the probability of two or more people share a common birthday if you have a group of 30 or 50 people?
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
