{"id":45,"date":"2021-01-12T22:19:31","date_gmt":"2021-01-12T22:19:31","guid":{"rendered":"https:\/\/textbooks.jaykesler.net\/introstats\/chapter\/counting\/"},"modified":"2023-06-25T11:33:06","modified_gmt":"2023-06-25T11:33:06","slug":"counting","status":"publish","type":"chapter","link":"https:\/\/textbooks.jaykesler.net\/introstats\/chapter\/counting\/","title":{"rendered":"Counting"},"content":{"raw":"<span class=\"full-width\"><img class=\"aligncenter size-full wp-image-328\" src=\"\/introstats\/wp-content\/uploads\/sites\/2\/2021\/01\/nick-fewings-8MGUft1c5bs-unsplash-scaled-1.jpg\" alt=\"Decorative - Soda cans, painted and organized in a rainbow\" width=\"2560\" height=\"1706\" \/><\/span>\r\n\r\nWe have seen that many situations call for a the <strong>Classical Approach<\/strong> when calculating probabilities; that is $P(A) = \\frac{ \\text{ number of ways } A \\text{ can occur}}{\\text{ number of different simple events}}$.\r\n\r\nFor example, if we are asked to calculate the probability of a sum of 3 when rolling two dice, the number of ways a 3 can occur is a simple calculation: you could get a 1 on the first die and a 2 on the second die, <span style=\"text-decoration: underline;\">or<\/span> you can get a 2 on the first die and a 1 on the second. To calculate the number of different simple events in the sample space, we can list all possibilities for rolling two dice:\r\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<th style=\"width: 50px;\">First<\/th>\r\n<th style=\"width: 50px;\">Second<\/th>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<td style=\"text-align: center;\">2<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<table style=\"border-collapse: collapse; width: 100px; height: 105px; display: inline; margin-right: 5px;\" border=\"0\">\r\n<tbody>\r\n<tr style=\"height: 15px;\">\r\n<td style=\"width: 50px; height: 15px;\"><strong>First<\/strong><\/td>\r\n<td style=\"width: 50px; height: 15px;\"><strong>Second<\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px;\">\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">1<\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px;\">\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px;\">\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">3<\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px;\">\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">4<\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px;\">\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">5<\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px;\">\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\r\n<td style=\"height: 15px; width: 50px; text-align: center;\">6<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 50px;\"><strong>First<\/strong><\/td>\r\n<td style=\"width: 50px;\"><strong>Second<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<td style=\"text-align: center;\">2<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 50px;\"><strong>First<\/strong><\/td>\r\n<td style=\"width: 50px;\"><strong>Second<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<td style=\"text-align: center;\">2<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 50px;\"><strong>First<\/strong><\/td>\r\n<td style=\"width: 50px;\"><strong>Second<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<td style=\"text-align: center;\">2<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 50px;\"><strong>First<\/strong><\/td>\r\n<td style=\"width: 50px;\"><strong>Second<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<td style=\"text-align: center;\">1<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<td style=\"text-align: center;\">2<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<td style=\"text-align: center;\">3<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<td style=\"text-align: center;\">4<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<td style=\"text-align: center;\">5<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<td style=\"text-align: center;\">6<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\nThere are 36 different possible simple events when rolling two dice, so the probability of getting a sum of three is $\\frac{2}{36} \\approx 0.0556 $\r\nA challenge arises, however, when either the numerator or the denominator (or both) is a large number. For example, if we wanted to know what the probability is of someone randomly guessing your social security number (SSN), we can use the classical approach.\r\n\r\n$P(\\text{guessing your SSN})=\\frac{\\text{how many SSN's you have}}{\\text{number of possible SSN's}}$\r\n\r\nYou only have one SSN, so the numerator is 1. To find the denominator, if we try to list out all possible SSN's as we did in the dice example above, we will be writing for a very long time because, as we will see, there are about a billion different possible SSN's a person could randomly choose from.\r\n<h2>1. Multiplication Counting Rule<\/h2>\r\n<div class=\"textbox\">\r\n\r\nThe <strong>multiplication counting rule<\/strong> says that if there are $m$ possible outcomes for one procedure, and there are $n$ possible outcomes for another procedure, then there are $m\\cdot n$ possible outcomes if both procedures are performed together.\r\n\r\n<\/div>\r\n<div class=\"textbox textbox--examples\"><header class=\"textbox__header\">\r\n<h3 class=\"textbox__title\">Example: Dice and Coin Flips<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">Suppose in one procedure has you rolling a die and recording the number it lands on, and another procedure has you flipping a quarter and recording whether it lands heads or tails.<\/div>\r\n<div style=\"padding-left: 30px;\">The first procedure has 6 possible outcomes (1, 2, 3, 4, 5 or 6), and the second procedure has 2 possible outcomes (heads or tails), so there are $6 \\cdot 2 = 12$ possible outcomes for rolling a die and flipping a quarter.<\/div>\r\n<div style=\"padding-left: 30px;\">I will list all 12 ways out for clarity, but keep in mind that the purpose of these counting rules is that we can count without having to list everything out. Here is the list of all 12 possible outcomes:<\/div>\r\n<div style=\"padding-left: 30px;\">\r\n<table style=\"border-collapse: collapse; width: 89.7004%; height: 108px;\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 25%; text-align: center;\">1, heads<\/td>\r\n<td style=\"width: 25%; text-align: center;\">4, heads<\/td>\r\n<td style=\"width: 25%; text-align: center;\">1, tails<\/td>\r\n<td style=\"width: 25%; text-align: center;\">4, tails<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 25%; text-align: center;\">2, heads<\/td>\r\n<td style=\"width: 25%; text-align: center;\">5, heads<\/td>\r\n<td style=\"width: 25%; text-align: center;\">2, tails<\/td>\r\n<td style=\"width: 25%; text-align: center;\">5, tails<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 25%; text-align: center;\">3, heads<\/td>\r\n<td style=\"width: 25%; text-align: center;\">6, heads<\/td>\r\n<td style=\"width: 25%; text-align: center;\">3, tails<\/td>\r\n<td style=\"width: 25%; text-align: center;\">6, tails<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\n<\/div>\r\n<\/div>\r\n<div>\r\n<div class=\"textbox textbox--examples\"><header class=\"textbox__header\">\r\n<h3 class=\"textbox__title\">Example: License Plate<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nIn California, pickup trucks have license plates that are formatted as follows: digit, letter, digit, digit, digit, digit, digit. For example, a truck may have the license plate <strong>7X74293<\/strong>. However, <strong>8RCB329<\/strong> would a license plate you could see on a sedan, not a truck.\r\n\r\nSuppose we are creating the very first truck license plate with this scheme. What is the probability that a randomly created license plate for a pickup truck will start with the number 7?\r\n\r\n<strong>Answer<\/strong>:\r\nTo solve this, we will use the Classical Approach to probability. We must first find the number of possible truck license plates that start with 7. Then we must find the number of possible truck license plates in total. Finally, the Classical Approach tells us to divide these.\r\n\r\nTo find the possible number licenses that start with 7, we note that there is only one way for a 7 to appear first, there are 26 possibilities for the next letter, there are 10 possibilities (0-9) for each of the next five spots on the license. So the number of license plates that start with 7 is $1\\cdot 26 \\cdot 10 \\cdot 10 \\cdot 10 \\cdot 10 \\cdot 10 =2,600,000$\r\n\r\nTo find the total possible number of license plates, we do a similar calculation as above, except this time there are 10 possibilities for the first spot since it doesn't have to be a 7. There are $10\\cdot 26 \\cdot 10 \\cdot 10 \\cdot 10 \\cdot 10 \\cdot 10 =26,000,000$\r\n\r\nFinally, the probability that the license plate will start with a 7 is $\\frac{2,600,000}{26,000,000} = 0.1$\r\n\r\n<\/div>\r\n<\/div>\r\n<h2>II. Factorial Rule<\/h2>\r\n<div class=\"textbox textbox--key-takeaways\"><header class=\"textbox__header\">\r\n<h3 class=\"textbox__title\">Factorial Notation<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nIn mathematics, we use the exclamation mark \"!\" as what is called \"factorial notation\". It means repeated multiplication by starting with a whole number and removing one each time.\r\n<div style=\"text-align: center;\">\r\n\r\n$n! = n\\cdot (n-1) \\cdot (n-2) \\cdot \\ldots \\cdot 3 \\cdot 2 \\cdot 1$\r\n\r\n<\/div>\r\n<div>For example $6! = 6 \\cdot 5 \\cdot 4 \\cdot 3 \\cdot 2 \\cdot 1 = 720$<\/div>\r\n<\/div>\r\n<div><\/div>\r\n<\/div>\r\n<div class=\"textbox\">The <strong>factorial rule<\/strong> says that if we have $n$ different items, then there are $n! $ ways of arranging them.<\/div>\r\n<div class=\"textbox textbox--examples\"><header class=\"textbox__header\">\r\n<h3 class=\"textbox__title\">Example: Delivery Routes<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nSuppose there are 3 people, Sarah, Dave, and Ahmed, delivering packages for Amazon, Inc. When they show up for work in the morning, they are each assigned one of three possible routes; one route goes to Roseville, one route goes to Rocklin, and one goes to Sacramento. The Rocklin route is always preferred because it has the least amount of traffic, and the Sacramento route is the least preferred since it has the most traffic.\r\n<div>In how many ways can their boss assign them to the routes?<\/div>\r\n<div><strong>Answer:<\/strong>\r\nSince there are 3 people to arrange into the different routes, there are $3! = 6$ different ways to assign each person to a route.<\/div>\r\n<div>Again, one of the purposes of counting rules is to avoid making lists, but for clarity, we list the 6 ways here, with each row representing one way to assign them:<\/div>\r\n<div>\r\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<th style=\"width: 33.3333%; text-align: center;\"><strong>Roseville Route<\/strong><\/th>\r\n<th style=\"width: 33.3333%; text-align: center;\"><strong>Rocklin Route<\/strong><\/th>\r\n<th style=\"width: 33.3333%; text-align: center;\"><strong>Sacramento Route<\/strong><\/th>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\r\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<div class=\"textbox spreadsheet\">\r\n<h3>Sheets: Factorials<\/h3>\r\nTo calculate a factorial using a spreadsheet, use the <strong>=FACT(n) <\/strong>formula. (<a href=\"https:\/\/support.google.com\/docs\/answer\/3093412?hl=en\">read more<\/a>)\r\n\r\nFor example, to calculate 11!, you can type into a cell <strong>=FACT(11)<\/strong> which evaluates to 39,916,800 which is 11!\r\n\r\n<\/div>\r\n<h2>III. Permutations Rule ($_nP_r$)<\/h2>\r\n<div class=\"textbox\">\r\n\r\nThe <strong>Permutations Rule<\/strong> says that if you have $n$ distinct items, and you will choose $r$ of them (without replacement), then the following formula gives the number of ways to do that when <span style=\"text-decoration: underline;\">order is important<\/span>:\r\n<p style=\"text-align: center;\">$$ _n P_r = \\frac{n!}{(n-r)!}$$<\/p>\r\n\r\n<\/div>\r\n<div>\r\n<div class=\"textbox textbox--examples\"><header class=\"textbox__header\">\r\n<h3 class=\"textbox__title\">Example: Order is Important<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nIn some situations, the <strong>order<\/strong> that things are in when they are chosen is important, and in other situations, the order is not important.\r\n\r\nIn the next example, <strong>Who's the Boss<\/strong>, we are choosing from a group of people where the first person we pick will be CEO, the second person we pick will be CFO and the third person will be coffee runner. Suppose we pick Yasameen first, Jayde second, and De'Ana third. That will be different from if we pick De'Ana first, Jayde second, and Yasameen third, because their positions in the company would be different. So order matters in this case.\r\n\r\nSuppose we had a box with 10 different colored scarves, and we are picking 3. If we don't care about order, then picking Red, then Green, then Blue would be the same as picking Green, then Blue, then Red, and we <span style=\"text-decoration: underline;\">would not<\/span> count those as two different combinations. In this case, this is not what we call <span style=\"text-decoration: underline;\">counting permutations<\/span>, but what we will call <span style=\"text-decoration: underline;\">counting combinations<\/span>, and we deal with those below in section <strong>IV. Combinations<\/strong>.\r\n\r\n<\/div>\r\n<\/div>\r\n&nbsp;\r\n\r\n<\/div>\r\n<div>\r\n<div class=\"textbox textbox--key-takeaways\"><header class=\"textbox__header\">\r\n<h3>Important Note<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nOne thing to keep in mind about <strong>permutations<\/strong> is that the <span style=\"text-decoration: underline;\">order of the items matters<\/span>. For example, if you are permuting 3 letters, <em>ABC<\/em> would count as one permutation, <em>BAC<\/em> would count as another, and <em>CBA<\/em> would count as another.\r\n\r\nWe will address the situation where the <span style=\"text-decoration: underline;\">order of the items doesn't matter<\/span> when we talk about <strong>combinations<\/strong> below.\r\n\r\n<\/div>\r\n<\/div>\r\n<div class=\"textbox textbox--examples\"><header class=\"textbox__header\">\r\n<h3 class=\"textbox__title\">Example: Who's the Boss<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nYou've just started your new company writing gaming apps for mobile phones. You have five friends, Amanda, Beatrice, Chloe, Destiny, and Everett, who want to work for your company, but you only need a CEO, a CFO, and a coffee runner (you're the programmer).\r\n\r\nIn how many ways can you choose from your 5 friends to fill the 3 positions?\r\n<h4>Solution<\/h4>\r\nSince we have 5 friends to choose from, we have $n=5$, and we have only 3 positions, so we will choose 3 of the 5 friends, so we have $r=3$.\r\n\r\n$$_nP_r = _5P_3 = \\frac{5!}{(5-3)!} = \\frac{5\\cdot 4\\cdot 3\\cdot 2\\cdot 1}{2\\cdot 1} = 5\\cdot 4\\cdot 3 = 60$$\r\n\r\nThere are 60 different ways to choose 3 friends from 5 people when order matters.\r\n\r\n<\/div>\r\n&nbsp;\r\n\r\n<\/div>\r\n<div class=\"textbox\">If the above result surprises you, try listing them all out. Start with five friends named A, B, C, D, &amp; E. Now list out combinations of 3 of them and see if you can find all 60.\r\nABC\r\nABD\r\nABE\r\nACB (recall order matters, so ABC $\\neq$ ACB)\r\nACD\r\n. (find)\r\n. (the)\r\n. (rest)\r\nNow that you've done that once, be glad that we have this new formula to count permutations, instead of having to list them all out to count them.<\/div>\r\n<h2>IV. Combinations Rule ($_nC_r$)<\/h2>\r\n<div class=\"textbox\">\r\n\r\nThe <strong>Combinations Rule<\/strong> says that if you have $n$ distinct items, and you will choose $r$ of them (without replacement), then the following formula gives the number of ways to do that when order is <em><span style=\"text-decoration: underline;\">not<\/span><\/em> important:$$ _n C_r = \\frac{n!}{(n-r)! \\cdot r!}$$\r\n\r\n<\/div>\r\n<div class=\"textbox textbox--examples\"><header class=\"textbox__header\">\r\n<h3 class=\"textbox__title\">Example: Digging Deeper<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nYou need some help digging holes for replacement fence posts that blew down in the last wind storm. You offer to pay \\$10\/hour to any of your friends who can help. Unfortunately, 8 of your friends say they can do it, but you don't have that kind of money. You decide that you only need 3 friends to help.\r\n\r\nHow many different ways can you choose 3 friends from the 8 who volunteered?\r\n<h4>Solution<\/h4>\r\nSince we have 8 friends to choose from, we have $n=8$, and we have only 3 positions, so we will choose 3 of the 8 friends, so we have $r=3$. Since <span style=\"text-decoration: underline;\">order does not matter<\/span> in this situation, we use the Combinations formula:\r\n\r\n$$_nC_r = _8C_3 = \\frac{8!}{(8-3)! (3)!} = \\frac{8\\cdot 7\\cdot 6 \\cdot 5\\cdot 4\\cdot 3\\cdot 2\\cdot 1}{(5\\cdot 4\\cdot 3\\cdot 2\\cdot 1) \\cdot ( 3\\cdot 2\\cdot 1} = \\frac{8\\cdot 7\\cdot 6}{ 3\\cdot 2\\cdot 1} = 8\\cdot 7 = 56$$\r\n\r\nThere are 56 different ways to choose 3 friends from 8 people when order does not matter.\r\n\r\n<\/div>\r\n<\/div>\r\n<div class=\"textbox spreadsheet\">\r\n<h3>Sheets: Combinations &amp; Permutations<\/h3>\r\nTo calculate a combination in most spreadsheet programs, use the function <strong>=COMBIN(n, r)<\/strong> (<a href=\"https:\/\/support.google.com\/docs\/answer\/3093400\">read more<\/a>)<strong>\r\n<\/strong>\r\n\r\nFor example, to calculate $_8C_3$, you type into a cell <strong>=COMBIN(8,3) <\/strong>which would evaluate to 56.\r\n\r\nTo calculate a permutation, use the function <strong>=PERMUT(n,r) <\/strong>(<a href=\"https:\/\/support.google.com\/docs\/answer\/3094036?hl=en\">read more<\/a>)\r\n\r\nFor example, to calculate $_5P_3$, you type into a cell <strong>=PERMUT(5,3) <\/strong>which would evaluate to 60.\r\n\r\n<\/div>\r\n<div><\/div>\r\n<\/div>\r\n<div class=\"textbox textbox--key-takeaways\"><header class=\"textbox__header\">\r\n<h3 class=\"textbox__title\">Key Takeaways<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">The reason for discussing methods of counting is that, in probability, we often need to know how many ways something <em>could<\/em> happen, and then use that information, along with the classical approach to probability, to calculate probabilities for events. Consider the following example. We need a way to count up the number of 11-letter combinations.<\/div>\r\n<\/div>\r\n<div>\r\n<div class=\"textbox textbox--examples\"><header class=\"textbox__header\">\r\n<h3 class=\"textbox__title\">Example: Lots of Letters<\/h3>\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nWhat is the probability that if 11 capitalized (upper-case) letters are typed, no letters are repeated? (assume the order of the letters matters)\r\n<h4>Solution<\/h4>\r\nLet's start by calling the event that we get 11 letters with no repeats event $A$. So we want to calculate $P(A)$, which is the probability that 11 capitalized letters have no repeats.\r\n\r\nWe need two pieces of information:\r\n<ol>\r\n \t<li>The number of 11 letter combinations that do not have two letters repeated (the order of the letters matter, so AB is different than BA)<\/li>\r\n \t<li>The number of things that could happen in this situation; that is to say, the total number of 11 letter combinations with and without repeats.<\/li>\r\n<\/ol>\r\nTo calculate the first item, the number of 11 letter combinations that do not have two letters repeated, recognize that this will follow the Permutation Rule, since we have 26 letters, we are choosing 11 of them (no repeats), and order matters. So we simply calculate $_{26}P_{11}$. Use the <strong>=PERMUT(26,11)<\/strong> function in Sheets.\r\n\r\n$$_{26}P_{11} =308,403,583,488,000$$\r\n\r\nSo, the number of 11 letter combinations that do not have two letters repeated is 308,403,583,488,000.\r\n\r\nTo calculate the second thing, the total number of 11 letter combinations with and without repeats, notice that we have 26 choices for the first letter, 26 choices for the second, 26 choices for the third, etc, all the way to 26 choices for the 11<sup>th<\/sup> letter. So this simply follows the Multiplication Counting Rule, and we simply need to multiply 26 to itself 11 times. You can use a spreadsheet to do this as well by typing <strong>=26^11<\/strong>\r\n\r\n$$26^{11} = 3.67034E+15$$\r\n\r\nThe spreadsheet gives a strange looking number that ends with \"E+15\". This is really just scientific notation that says move the decimal 15 places to the right. The problem is that $26^{11}$ is not 3,670,340,000,000,000 because the scientific notation has done some rounding. If you're using Google Sheets on the website, to get the full number, click on the cell that has the scientific notation number, go to the <strong>Format<\/strong> menu, hover over <strong>Number<\/strong>, and in the menu that pops up, click <strong>Number 1,000.12<\/strong>\r\n\r\n<span class=\"full-width\"><img class=\"aligncenter size-full wp-image-335\" src=\"\/introstats\/wp-content\/uploads\/sites\/2\/2021\/01\/Sheets_number_format.png\" alt=\"\" width=\"941\" height=\"742\" \/><\/span>\r\n\r\nNow we see the following:\r\n\r\n$$26^{11} = 3,670,344,486,987,780$$\r\nFinally, the classical approach to probability says that we should divide the number of ways an event can happen (<span data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:308403583488000}\" data-sheets-formula=\"=permut(26,11)\">308,403,583,488,000 in this case) by the total number of things that could actually happen (3,670,344,486,987,780 in this case). We can do this in a spreadsheet easily. If the former value is in cell A1 and the latter value is in cell A2, then in another cell, we type <strong>=A1\/A2<\/strong> and find our answer.<\/span>\r\n\r\n$$P(A) = \\frac{308,403,583,488,000}{3,670,344,486,987,780} = 0.084$$\r\n\r\n<\/div>\r\n<div><\/div>\r\n<\/div>\r\n&nbsp;\r\n\r\n<\/div>\r\n&nbsp;\r\n\r\n<\/div>","rendered":"<p><span class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-328\" src=\"\/introstats\/wp-content\/uploads\/sites\/2\/2021\/01\/nick-fewings-8MGUft1c5bs-unsplash-scaled-1.jpg\" alt=\"Decorative - Soda cans, painted and organized in a rainbow\" width=\"2560\" height=\"1706\" \/><\/span><\/p>\n<p>We have seen that many situations call for a the <strong>Classical Approach<\/strong> when calculating probabilities; that is $P(A) = \\frac{ \\text{ number of ways } A \\text{ can occur}}{\\text{ number of different simple events}}$.<\/p>\n<p>For example, if we are asked to calculate the probability of a sum of 3 when rolling two dice, the number of ways a 3 can occur is a simple calculation: you could get a 1 on the first die and a 2 on the second die, <span style=\"text-decoration: underline;\">or<\/span> you can get a 2 on the first die and a 1 on the second. To calculate the number of different simple events in the sample space, we can list all possibilities for rolling two dice:<\/p>\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\">\n<tbody>\n<tr>\n<th style=\"width: 50px;\">First<\/th>\n<th style=\"width: 50px;\">Second<\/th>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">1<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">1<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">1<\/td>\n<td style=\"text-align: center;\">3<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">1<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">1<\/td>\n<td style=\"text-align: center;\">5<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">1<\/td>\n<td style=\"text-align: center;\">6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"border-collapse: collapse; width: 100px; height: 105px; display: inline; margin-right: 5px;\">\n<tbody>\n<tr style=\"height: 15px;\">\n<td style=\"width: 50px; height: 15px;\"><strong>First<\/strong><\/td>\n<td style=\"width: 50px; height: 15px;\"><strong>Second<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 15px;\">\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\n<td style=\"height: 15px; width: 50px; text-align: center;\">1<\/td>\n<\/tr>\n<tr style=\"height: 15px;\">\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\n<\/tr>\n<tr style=\"height: 15px;\">\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\n<td style=\"height: 15px; width: 50px; text-align: center;\">3<\/td>\n<\/tr>\n<tr style=\"height: 15px;\">\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\n<td style=\"height: 15px; width: 50px; text-align: center;\">4<\/td>\n<\/tr>\n<tr style=\"height: 15px;\">\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\n<td style=\"height: 15px; width: 50px; text-align: center;\">5<\/td>\n<\/tr>\n<tr style=\"height: 15px;\">\n<td style=\"height: 15px; width: 50px; text-align: center;\">2<\/td>\n<td style=\"height: 15px; width: 50px; text-align: center;\">6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\">\n<tbody>\n<tr>\n<td style=\"width: 50px;\"><strong>First<\/strong><\/td>\n<td style=\"width: 50px;\"><strong>Second<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">3<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">3<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">3<\/td>\n<td style=\"text-align: center;\">3<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">3<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">3<\/td>\n<td style=\"text-align: center;\">5<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">3<\/td>\n<td style=\"text-align: center;\">6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\">\n<tbody>\n<tr>\n<td style=\"width: 50px;\"><strong>First<\/strong><\/td>\n<td style=\"width: 50px;\"><strong>Second<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">4<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">4<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">4<\/td>\n<td style=\"text-align: center;\">3<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">4<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">4<\/td>\n<td style=\"text-align: center;\">5<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">4<\/td>\n<td style=\"text-align: center;\">6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\">\n<tbody>\n<tr>\n<td style=\"width: 50px;\"><strong>First<\/strong><\/td>\n<td style=\"width: 50px;\"><strong>Second<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">5<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">5<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">5<\/td>\n<td style=\"text-align: center;\">3<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">5<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">5<\/td>\n<td style=\"text-align: center;\">5<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">5<\/td>\n<td style=\"text-align: center;\">6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"border-collapse: collapse; width: 100px; height: 292px; display: inline; margin-right: 5px;\">\n<tbody>\n<tr>\n<td style=\"width: 50px;\"><strong>First<\/strong><\/td>\n<td style=\"width: 50px;\"><strong>Second<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">6<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">6<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">6<\/td>\n<td style=\"text-align: center;\">3<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">6<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">6<\/td>\n<td style=\"text-align: center;\">5<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">6<\/td>\n<td style=\"text-align: center;\">6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>There are 36 different possible simple events when rolling two dice, so the probability of getting a sum of three is $\\frac{2}{36} \\approx 0.0556 $<br \/>\nA challenge arises, however, when either the numerator or the denominator (or both) is a large number. For example, if we wanted to know what the probability is of someone randomly guessing your social security number (SSN), we can use the classical approach.<\/p>\n<p>$P(\\text{guessing your SSN})=\\frac{\\text{how many SSN&#8217;s you have}}{\\text{number of possible SSN&#8217;s}}$<\/p>\n<p>You only have one SSN, so the numerator is 1. To find the denominator, if we try to list out all possible SSN&#8217;s as we did in the dice example above, we will be writing for a very long time because, as we will see, there are about a billion different possible SSN&#8217;s a person could randomly choose from.<\/p>\n<h2>1. Multiplication Counting Rule<\/h2>\n<div class=\"textbox\">\n<p>The <strong>multiplication counting rule<\/strong> says that if there are $m$ possible outcomes for one procedure, and there are $n$ possible outcomes for another procedure, then there are $m\\cdot n$ possible outcomes if both procedures are performed together.<\/p>\n<\/div>\n<div class=\"textbox textbox--examples\">\n<header class=\"textbox__header\">\n<h3 class=\"textbox__title\">Example: Dice and Coin Flips<\/h3>\n<\/header>\n<div class=\"textbox__content\">Suppose in one procedure has you rolling a die and recording the number it lands on, and another procedure has you flipping a quarter and recording whether it lands heads or tails.<\/div>\n<div style=\"padding-left: 30px;\">The first procedure has 6 possible outcomes (1, 2, 3, 4, 5 or 6), and the second procedure has 2 possible outcomes (heads or tails), so there are $6 \\cdot 2 = 12$ possible outcomes for rolling a die and flipping a quarter.<\/div>\n<div style=\"padding-left: 30px;\">I will list all 12 ways out for clarity, but keep in mind that the purpose of these counting rules is that we can count without having to list everything out. Here is the list of all 12 possible outcomes:<\/div>\n<div style=\"padding-left: 30px;\">\n<table style=\"border-collapse: collapse; width: 89.7004%; height: 108px;\">\n<tbody>\n<tr>\n<td style=\"width: 25%; text-align: center;\">1, heads<\/td>\n<td style=\"width: 25%; text-align: center;\">4, heads<\/td>\n<td style=\"width: 25%; text-align: center;\">1, tails<\/td>\n<td style=\"width: 25%; text-align: center;\">4, tails<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 25%; text-align: center;\">2, heads<\/td>\n<td style=\"width: 25%; text-align: center;\">5, heads<\/td>\n<td style=\"width: 25%; text-align: center;\">2, tails<\/td>\n<td style=\"width: 25%; text-align: center;\">5, tails<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 25%; text-align: center;\">3, heads<\/td>\n<td style=\"width: 25%; text-align: center;\">6, heads<\/td>\n<td style=\"width: 25%; text-align: center;\">3, tails<\/td>\n<td style=\"width: 25%; text-align: center;\">6, tails<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<div>\n<div class=\"textbox textbox--examples\">\n<header class=\"textbox__header\">\n<h3 class=\"textbox__title\">Example: License Plate<\/h3>\n<\/header>\n<div class=\"textbox__content\">\n<p>In California, pickup trucks have license plates that are formatted as follows: digit, letter, digit, digit, digit, digit, digit. For example, a truck may have the license plate <strong>7X74293<\/strong>. However, <strong>8RCB329<\/strong> would a license plate you could see on a sedan, not a truck.<\/p>\n<p>Suppose we are creating the very first truck license plate with this scheme. What is the probability that a randomly created license plate for a pickup truck will start with the number 7?<\/p>\n<p><strong>Answer<\/strong>:<br \/>\nTo solve this, we will use the Classical Approach to probability. We must first find the number of possible truck license plates that start with 7. Then we must find the number of possible truck license plates in total. Finally, the Classical Approach tells us to divide these.<\/p>\n<p>To find the possible number licenses that start with 7, we note that there is only one way for a 7 to appear first, there are 26 possibilities for the next letter, there are 10 possibilities (0-9) for each of the next five spots on the license. So the number of license plates that start with 7 is $1\\cdot 26 \\cdot 10 \\cdot 10 \\cdot 10 \\cdot 10 \\cdot 10 =2,600,000$<\/p>\n<p>To find the total possible number of license plates, we do a similar calculation as above, except this time there are 10 possibilities for the first spot since it doesn&#8217;t have to be a 7. There are $10\\cdot 26 \\cdot 10 \\cdot 10 \\cdot 10 \\cdot 10 \\cdot 10 =26,000,000$<\/p>\n<p>Finally, the probability that the license plate will start with a 7 is $\\frac{2,600,000}{26,000,000} = 0.1$<\/p>\n<\/div>\n<\/div>\n<h2>II. Factorial Rule<\/h2>\n<div class=\"textbox textbox--key-takeaways\">\n<header class=\"textbox__header\">\n<h3 class=\"textbox__title\">Factorial Notation<\/h3>\n<\/header>\n<div class=\"textbox__content\">\n<p>In mathematics, we use the exclamation mark &#8220;!&#8221; as what is called &#8220;factorial notation&#8221;. It means repeated multiplication by starting with a whole number and removing one each time.<\/p>\n<div style=\"text-align: center;\">\n<p>$n! = n\\cdot (n-1) \\cdot (n-2) \\cdot \\ldots \\cdot 3 \\cdot 2 \\cdot 1$<\/p>\n<\/div>\n<div>For example $6! = 6 \\cdot 5 \\cdot 4 \\cdot 3 \\cdot 2 \\cdot 1 = 720$<\/div>\n<\/div>\n<div><\/div>\n<\/div>\n<div class=\"textbox\">The <strong>factorial rule<\/strong> says that if we have $n$ different items, then there are $n! $ ways of arranging them.<\/div>\n<div class=\"textbox textbox--examples\">\n<header class=\"textbox__header\">\n<h3 class=\"textbox__title\">Example: Delivery Routes<\/h3>\n<\/header>\n<div class=\"textbox__content\">\n<p>Suppose there are 3 people, Sarah, Dave, and Ahmed, delivering packages for Amazon, Inc. When they show up for work in the morning, they are each assigned one of three possible routes; one route goes to Roseville, one route goes to Rocklin, and one goes to Sacramento. The Rocklin route is always preferred because it has the least amount of traffic, and the Sacramento route is the least preferred since it has the most traffic.<\/p>\n<div>In how many ways can their boss assign them to the routes?<\/div>\n<div><strong>Answer:<\/strong><br \/>\nSince there are 3 people to arrange into the different routes, there are $3! = 6$ different ways to assign each person to a route.<\/div>\n<div>Again, one of the purposes of counting rules is to avoid making lists, but for clarity, we list the 6 ways here, with each row representing one way to assign them:<\/div>\n<div>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<th style=\"width: 33.3333%; text-align: center;\"><strong>Roseville Route<\/strong><\/th>\n<th style=\"width: 33.3333%; text-align: center;\"><strong>Rocklin Route<\/strong><\/th>\n<th style=\"width: 33.3333%; text-align: center;\"><strong>Sacramento Route<\/strong><\/th>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%; text-align: center;\">Ahmed<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Sarah<\/td>\n<td style=\"width: 33.3333%; text-align: center;\">Dave<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"textbox spreadsheet\">\n<h3>Sheets: Factorials<\/h3>\n<p>To calculate a factorial using a spreadsheet, use the <strong>=FACT(n) <\/strong>formula. (<a href=\"https:\/\/support.google.com\/docs\/answer\/3093412?hl=en\">read more<\/a>)<\/p>\n<p>For example, to calculate 11!, you can type into a cell <strong>=FACT(11)<\/strong> which evaluates to 39,916,800 which is 11!<\/p>\n<\/div>\n<h2>III. Permutations Rule ($_nP_r$)<\/h2>\n<div class=\"textbox\">\n<p>The <strong>Permutations Rule<\/strong> says that if you have $n$ distinct items, and you will choose $r$ of them (without replacement), then the following formula gives the number of ways to do that when <span style=\"text-decoration: underline;\">order is important<\/span>:<\/p>\n<p style=\"text-align: center;\">$$ _n P_r = \\frac{n!}{(n-r)!}$$<\/p>\n<\/div>\n<div>\n<div class=\"textbox textbox--examples\">\n<header class=\"textbox__header\">\n<h3 class=\"textbox__title\">Example: Order is Important<\/h3>\n<\/header>\n<div class=\"textbox__content\">\n<p>In some situations, the <strong>order<\/strong> that things are in when they are chosen is important, and in other situations, the order is not important.<\/p>\n<p>In the next example, <strong>Who&#8217;s the Boss<\/strong>, we are choosing from a group of people where the first person we pick will be CEO, the second person we pick will be CFO and the third person will be coffee runner. Suppose we pick Yasameen first, Jayde second, and De&#8217;Ana third. That will be different from if we pick De&#8217;Ana first, Jayde second, and Yasameen third, because their positions in the company would be different. So order matters in this case.<\/p>\n<p>Suppose we had a box with 10 different colored scarves, and we are picking 3. If we don&#8217;t care about order, then picking Red, then Green, then Blue would be the same as picking Green, then Blue, then Red, and we <span style=\"text-decoration: underline;\">would not<\/span> count those as two different combinations. In this case, this is not what we call <span style=\"text-decoration: underline;\">counting permutations<\/span>, but what we will call <span style=\"text-decoration: underline;\">counting combinations<\/span>, and we deal with those below in section <strong>IV. Combinations<\/strong>.<\/p>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<div>\n<div class=\"textbox textbox--key-takeaways\">\n<header class=\"textbox__header\">\n<h3>Important Note<\/h3>\n<\/header>\n<div class=\"textbox__content\">\n<p>One thing to keep in mind about <strong>permutations<\/strong> is that the <span style=\"text-decoration: underline;\">order of the items matters<\/span>. For example, if you are permuting 3 letters, <em>ABC<\/em> would count as one permutation, <em>BAC<\/em> would count as another, and <em>CBA<\/em> would count as another.<\/p>\n<p>We will address the situation where the <span style=\"text-decoration: underline;\">order of the items doesn&#8217;t matter<\/span> when we talk about <strong>combinations<\/strong> below.<\/p>\n<\/div>\n<\/div>\n<div class=\"textbox textbox--examples\">\n<header class=\"textbox__header\">\n<h3 class=\"textbox__title\">Example: Who&#8217;s the Boss<\/h3>\n<\/header>\n<div class=\"textbox__content\">\n<p>You&#8217;ve just started your new company writing gaming apps for mobile phones. You have five friends, Amanda, Beatrice, Chloe, Destiny, and Everett, who want to work for your company, but you only need a CEO, a CFO, and a coffee runner (you&#8217;re the programmer).<\/p>\n<p>In how many ways can you choose from your 5 friends to fill the 3 positions?<\/p>\n<h4>Solution<\/h4>\n<p>Since we have 5 friends to choose from, we have $n=5$, and we have only 3 positions, so we will choose 3 of the 5 friends, so we have $r=3$.<\/p>\n<p>$$_nP_r = _5P_3 = \\frac{5!}{(5-3)!} = \\frac{5\\cdot 4\\cdot 3\\cdot 2\\cdot 1}{2\\cdot 1} = 5\\cdot 4\\cdot 3 = 60$$<\/p>\n<p>There are 60 different ways to choose 3 friends from 5 people when order matters.<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"textbox\">If the above result surprises you, try listing them all out. Start with five friends named A, B, C, D, &amp; E. Now list out combinations of 3 of them and see if you can find all 60.<br \/>\nABC<br \/>\nABD<br \/>\nABE<br \/>\nACB (recall order matters, so ABC $\\neq$ ACB)<br \/>\nACD<br \/>\n. (find)<br \/>\n. (the)<br \/>\n. (rest)<br \/>\nNow that you&#8217;ve done that once, be glad that we have this new formula to count permutations, instead of having to list them all out to count them.<\/div>\n<h2>IV. Combinations Rule ($_nC_r$)<\/h2>\n<div class=\"textbox\">\n<p>The <strong>Combinations Rule<\/strong> says that if you have $n$ distinct items, and you will choose $r$ of them (without replacement), then the following formula gives the number of ways to do that when order is <em><span style=\"text-decoration: underline;\">not<\/span><\/em> important:$$ _n C_r = \\frac{n!}{(n-r)! \\cdot r!}$$<\/p>\n<\/div>\n<div class=\"textbox textbox--examples\">\n<header class=\"textbox__header\">\n<h3 class=\"textbox__title\">Example: Digging Deeper<\/h3>\n<\/header>\n<div class=\"textbox__content\">\n<p>You need some help digging holes for replacement fence posts that blew down in the last wind storm. You offer to pay \\$10\/hour to any of your friends who can help. Unfortunately, 8 of your friends say they can do it, but you don&#8217;t have that kind of money. You decide that you only need 3 friends to help.<\/p>\n<p>How many different ways can you choose 3 friends from the 8 who volunteered?<\/p>\n<h4>Solution<\/h4>\n<p>Since we have 8 friends to choose from, we have $n=8$, and we have only 3 positions, so we will choose 3 of the 8 friends, so we have $r=3$. Since <span style=\"text-decoration: underline;\">order does not matter<\/span> in this situation, we use the Combinations formula:<\/p>\n<p>$$_nC_r = _8C_3 = \\frac{8!}{(8-3)! (3)!} = \\frac{8\\cdot 7\\cdot 6 \\cdot 5\\cdot 4\\cdot 3\\cdot 2\\cdot 1}{(5\\cdot 4\\cdot 3\\cdot 2\\cdot 1) \\cdot ( 3\\cdot 2\\cdot 1} = \\frac{8\\cdot 7\\cdot 6}{ 3\\cdot 2\\cdot 1} = 8\\cdot 7 = 56$$<\/p>\n<p>There are 56 different ways to choose 3 friends from 8 people when order does not matter.<\/p>\n<\/div>\n<\/div>\n<div class=\"textbox spreadsheet\">\n<h3>Sheets: Combinations &amp; Permutations<\/h3>\n<p>To calculate a combination in most spreadsheet programs, use the function <strong>=COMBIN(n, r)<\/strong> (<a href=\"https:\/\/support.google.com\/docs\/answer\/3093400\">read more<\/a>)<strong><br \/>\n<\/strong><\/p>\n<p>For example, to calculate $_8C_3$, you type into a cell <strong>=COMBIN(8,3) <\/strong>which would evaluate to 56.<\/p>\n<p>To calculate a permutation, use the function <strong>=PERMUT(n,r) <\/strong>(<a href=\"https:\/\/support.google.com\/docs\/answer\/3094036?hl=en\">read more<\/a>)<\/p>\n<p>For example, to calculate $_5P_3$, you type into a cell <strong>=PERMUT(5,3) <\/strong>which would evaluate to 60.<\/p>\n<\/div>\n<div><\/div>\n<\/div>\n<div class=\"textbox textbox--key-takeaways\">\n<header class=\"textbox__header\">\n<h3 class=\"textbox__title\">Key Takeaways<\/h3>\n<\/header>\n<div class=\"textbox__content\">The reason for discussing methods of counting is that, in probability, we often need to know how many ways something <em>could<\/em> happen, and then use that information, along with the classical approach to probability, to calculate probabilities for events. Consider the following example. We need a way to count up the number of 11-letter combinations.<\/div>\n<\/div>\n<div>\n<div class=\"textbox textbox--examples\">\n<header class=\"textbox__header\">\n<h3 class=\"textbox__title\">Example: Lots of Letters<\/h3>\n<\/header>\n<div class=\"textbox__content\">\n<p>What is the probability that if 11 capitalized (upper-case) letters are typed, no letters are repeated? (assume the order of the letters matters)<\/p>\n<h4>Solution<\/h4>\n<p>Let&#8217;s start by calling the event that we get 11 letters with no repeats event $A$. So we want to calculate $P(A)$, which is the probability that 11 capitalized letters have no repeats.<\/p>\n<p>We need two pieces of information:<\/p>\n<ol>\n<li>The number of 11 letter combinations that do not have two letters repeated (the order of the letters matter, so AB is different than BA)<\/li>\n<li>The number of things that could happen in this situation; that is to say, the total number of 11 letter combinations with and without repeats.<\/li>\n<\/ol>\n<p>To calculate the first item, the number of 11 letter combinations that do not have two letters repeated, recognize that this will follow the Permutation Rule, since we have 26 letters, we are choosing 11 of them (no repeats), and order matters. So we simply calculate $_{26}P_{11}$. Use the <strong>=PERMUT(26,11)<\/strong> function in Sheets.<\/p>\n<p>$$_{26}P_{11} =308,403,583,488,000$$<\/p>\n<p>So, the number of 11 letter combinations that do not have two letters repeated is 308,403,583,488,000.<\/p>\n<p>To calculate the second thing, the total number of 11 letter combinations with and without repeats, notice that we have 26 choices for the first letter, 26 choices for the second, 26 choices for the third, etc, all the way to 26 choices for the 11<sup>th<\/sup> letter. So this simply follows the Multiplication Counting Rule, and we simply need to multiply 26 to itself 11 times. You can use a spreadsheet to do this as well by typing <strong>=26^11<\/strong><\/p>\n<p>$$26^{11} = 3.67034E+15$$<\/p>\n<p>The spreadsheet gives a strange looking number that ends with &#8220;E+15&#8221;. This is really just scientific notation that says move the decimal 15 places to the right. The problem is that $26^{11}$ is not 3,670,340,000,000,000 because the scientific notation has done some rounding. If you&#8217;re using Google Sheets on the website, to get the full number, click on the cell that has the scientific notation number, go to the <strong>Format<\/strong> menu, hover over <strong>Number<\/strong>, and in the menu that pops up, click <strong>Number 1,000.12<\/strong><\/p>\n<p><span class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-335\" src=\"\/introstats\/wp-content\/uploads\/sites\/2\/2021\/01\/Sheets_number_format.png\" alt=\"\" width=\"941\" height=\"742\" \/><\/span><\/p>\n<p>Now we see the following:<\/p>\n<p>$$26^{11} = 3,670,344,486,987,780$$<br \/>\nFinally, the classical approach to probability says that we should divide the number of ways an event can happen (<span data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:308403583488000}\" data-sheets-formula=\"=permut(26,11)\">308,403,583,488,000 in this case) by the total number of things that could actually happen (3,670,344,486,987,780 in this case). We can do this in a spreadsheet easily. If the former value is in cell A1 and the latter value is in cell A2, then in another cell, we type <strong>=A1\/A2<\/strong> and find our answer.<\/span><\/p>\n<p>$$P(A) = \\frac{308,403,583,488,000}{3,670,344,486,987,780} = 0.084$$<\/p>\n<\/div>\n<div><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"author":1,"menu_order":6,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-45","chapter","type-chapter","status-publish","hentry"],"part":39,"_links":{"self":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":4,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters\/45\/revisions"}],"predecessor-version":[{"id":631,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters\/45\/revisions\/631"}],"part":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/parts\/39"}],"metadata":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters\/45\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapter-type?post=45"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/contributor?post=45"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/license?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}