# Probability Theory... little help

**URL:** <https://boards.straightdope.com/t/probability-theory-little-help/318460>\
**Category:** Factual Questions\
**Created:** [August 24, 2005, 6:15pm UTC](https://boards.straightdope.com/t/probability-theory-little-help/318460 "2005-08-24T18:15:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SiXSwordS](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SiXSwordS](https://boards.straightdope.com/u/SiXSwordS)\
**Post date:** [August 24, 2005, 6:15pm UTC](https://boards.straightdope.com/t/probability-theory-little-help/318460/1 "2005-08-24T18:15:27Z")

</div>

I’ve been trying to learn probability and other math from books and from online tutorials. It’s a little hard to ask questions because I don’t understand the topic yet. This is my attempt…

Let’s say that there are four cards: _w,x,y,z_ but only the exact combination, _w,x,y,z_ is winning. (_w,x,z,y_ **;** _x,w,z,y_ etc. are losing combinations.)

Using the factorial function, (4! = 24) for the total number of possible combinations and (0! = 1) for the number of ‘winning’ combinations, the odds of getting the ‘winning’ combination is 1 : 24.

Now, if one need only get three of the four to be ‘right,’ it would seem the odds would be better. However, the odds are the same. (0! = 1 = 1!) The combinations, _w,x,y,_\* and \* _,x,y,z_ are logically equivalent to \* w,x,y,z\*.

The real complication for me comes if one need only get _two_ or fewer cards right. If, by two right you mean: \* w,x,\*,\*\*, then (2! = 2) there are two winning combinations. Likewise, if one need only get _one_ card right then (3! = 6) the odds are 6 : 24. (FWIW, I had to verify all of this for myself with fingers and toes math.)

But, if by two you mean _any_ two: (_w,x,_,\* **;** _,x,y,_ **;** \* or **,_,y,z_ ) or if by _one \* you mean \* any \* one: (w,,_,\* ; _,x,_,**\* ;\*\* _,_,y,\* \* or \*\*,_,_,z \* then the logical equivalents throw a wrench into the factorial machine.

_Any_ two gives you 4 : 24. (\*\*,x,y,\* \* --\> 2! = 2 but one of those combinations was already counted in the equation: _w,x,_,\* \* --\> 2! = 2. (i.e.: _w,x,y,z ) Since the same is true for \*\*,,y,z_, the total is (2! + (2! - 1) + (2! - 1)) = 4. ( I’m working on the assumption that while I might have the right answer, I may have brought in the factorials where they don’t belong.)

My question is, what is the ‘generic’ or theoretical equation used to give you the ‘winning’ combinations in the case of _any_ one or two? What would really help would be the “a^2 + b^2 = c^2” answer… or better yet, the “pythagorean theorem” answer, not 9 + 16 = 25.

Explaining that you just finished teaching your friend, Joe that the answers are four and fifteen respectively and that your friend, Joe is your 12 year old, paralyzed, lobotomized cocker spaniel who can only communicate by blinking his left eye will not help.

Anything I could use to search wolfram or similar sites to find instruction on this type of problem would really help!

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [August 24, 2005, 6:28pm UTC](https://boards.straightdope.com/t/probability-theory-little-help/318460/2 "2005-08-24T18:28:56Z")

</div>

First off, a slight nitpick: If the probability of an event happening is 1/24, then the odds are 23:1. Basically, probability is the count of favorable events divided by the count of all possible events, and odds are the count of favorable events compared to the count of unfavorable events.

Now then…

You’re right in thinking that the probability of getting w, x, y, z is 1/24, but 0! has nothing to do with it. There’s 1 favorable outcome and 24 possible ones, so that’s where you get 1/24.

If w, x, y and z are the only possible cards, and you know where three of them fell, then you know where the fourth is as well. So the probability of getting three right is still 1/24.

Two cards is a little more complicated. There are two sequences with w, x; two with x, y; and two with y, z. The complication here is w, x, y, z accounts for half of each of those figures, so you need to subtract out all but one of the occurences (or all of them, if you want to know the probability of getting exactly two cards right). So I get 4/24 for the probability of getting at least two the cards right, and 3/24 for the probability of getting exactly two cards right.

One card is even more complicated, so I’m going to use a shortcut. So far there are 4 outcomes where more than one card is right. Because I know about [derangements](http://mathworld.wolfram.com/Derangement.html), I know that there are 9 outcomes where no card is in its proper position. So it follows that there are 11 distinct outcomes where exactly one card is in the right position.

Unfortunately, there’s no royal road to learning this sort of stuff. You just have to do a lot of problems and spend some time understanding the right answers.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [August 24, 2005, 7:08pm UTC](https://boards.straightdope.com/t/probability-theory-little-help/318460/3 "2005-08-24T19:08:31Z")

</div>

> [@ultrafilter](#):
>
> First off, a slight nitpick: If the probability of an event happening is 1/24, then the odds are 23:1.

i.e. 23 to 1 against, or 1 to 23 in favor.

Another slight nitpick, or perhaps a warning: In the contexts of probability and combinatorics (= counting how many arrangements, etc. are possible), the word “combinations” has a specific meaning that is different from the way you used it in the OP (and from the way the word is often used in ordinary speech). Specifically, combinations are the different ways you can select _r_ objects if you have _n_ to choose from and the order in which you select them does _not_ matter (as opposed to **permutations** , in which order _is_ significant).

---

<div class="post-metadata">

**Author:** ![RM\_Mentock](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@RM\_Mentock](https://boards.straightdope.com/u/RM_Mentock)\
**Post date:** [August 24, 2005, 7:09pm UTC](https://boards.straightdope.com/t/probability-theory-little-help/318460/4 "2005-08-24T19:09:43Z")

</div>

> [@SiXSwordS](#):
>
> _Any_ two gives you 4 : 24.

I would have said 7, out of 24

> [@ultrafilter](#):
>
> You’re right in thinking that the probability of getting w, x, y, z is 1/24, but 0! has nothing to do with it.

But 0! is 1.

> [@](#):
>
> Two cards is a little more complicated. There are two sequences with w, x; two with x, y; and two with y, z. The complication here is w, x, y, z accounts for half of each of those figures, so you need to subtract out all but one of the occurences (or all of them, if you want to know the probability of getting exactly two cards right). So I get 4/24 for the probability of getting at least two the cards right, and 3/24 for the probability of getting exactly two cards right.

I think you forgot the three combinations with w,y right; w,z right; and x,z right.

> [@](#):
>
> So it follows that there are 11 distinct outcomes where exactly one card is in the right position.

8, by my count

---

<div class="post-metadata">

**Author:** ![Spiritus\_Mundi](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@Spiritus\_Mundi](https://boards.straightdope.com/u/Spiritus_Mundi)\
**Post date:** [August 24, 2005, 7:32pm UTC](https://boards.straightdope.com/t/probability-theory-little-help/318460/5 "2005-08-24T19:32:32Z")

</div>

> [@](#):
>
> Any two gives you 4 : 24. (_,x,y,_ --\> 2! = 2 but one of those combinations was already counted in the equation: w,x,_,_ --\> 2! = 2. (i.e.: w,x,y,z ) Since the same is true for _,_,y,z, the total is (2! + (2! - 1) + (2! - 1)) = 4. ( I’m working on the assumption that while I might have the right answer, I may have brought in the factorials where they don’t belong.)

Not quite. For simplicities sake , let’s use numbers so the ordering principles are a little more clear. Fair warning, it has been more than 2 decades since I studied probability theory.

**1 2 3 4**  
**1 2 4 3**  
**1 3 2 4**  
1 3 4 2  
1 4 2 3  
**1 4 3 2**  
**2 1 3 4**  
2 1 4 3  
2 3 1 4  
2 3 4 1  
2 4 1 3  
2 4 3 1  
3 1 2 4  
3 1 4 2  
**3 2 1 4**  
3 2 4 1  
3 4 1 2  
3 4 2 1  
4 1 2 3  
4 1 3 2  
4 2 1 3  
**4 2 3 1**  
4 3 1 2  
4 3 2 1

So, the number of winning combinations is 7. 6 cases in which exactly 2 “cards” are in the correct position, and 1 case in which all four cards are in the correct position (as you note, exactly 3 cards in order yields the same case as exactly 4 cards in order). The key word here is “combinations”.

The number of sequences in which exactly _k_ cards are in the right position is equivalent to the number of ways for us to choose _k_ cards from the ordered sequence (1 2 3 4). C[sub]4,2[/sub] = 4!/(2!\*(2)! = 24/4 = 6. Let’s call that E[sub]2[/sub] for convenience.

The number of sequences in which two or more cards are in proper order = E[sub]2[/sub] + E[sub]4[/sub] + E[sub]4[/sub] = 6 + 0 + 1 = 7.

Unfortunately, I know of no generalized formula to abtract this to larger sets. I know that it is not possible to have exactly 3 cards in position. I know that if I chose any 2 out of 4 cards to be correct (order unimportant) it yields 2 permutations: one in which teh remaining cards are ordered, one in which they are not. If the remaining cards are ordered, then all four cards are in order so we do not have exactly 2. Thus, C[sub]4,2[/sub]\*(P[sub]2,2[/sub]-1) reduces to C[sub]4,2[/sub] = 6. For exactly 1 correct card the number of possible permutations after the choice is 6, with three arrangements in which exactly one of the remaining :cards" is correct and on in which all are correct.

C[sub]4,4[/sub] = 1  
C[sub]4,3[/sub]_(P[sub]1,1[/sub]-1) = 0  
C[sub]4,2[/sub]_(P[sub]2,2[/sub]-1) = 6  
C[sub]4,1[/sub]\*(P[sub]3,3[/sub]-3-1) = 8

I know of no way to generalize a formula, though.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [August 24, 2005, 7:35pm UTC](https://boards.straightdope.com/t/probability-theory-little-help/318460/6 "2005-08-24T19:35:43Z")

</div>

> [@RM Mentock](#):
>
> But 0! is 1.

But why is that relevant here?

> [@](#):
>
> I think you forgot the three combinations with w,y right; w,z right; and x,z right.

That’s true. So 6 combinations with exactly two cards right, 1 with exactly four cards right, and 9 with no cards right. Makes 8 with one card right.

---

<div class="post-metadata">

**Author:** ![SiXSwordS](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SiXSwordS](https://boards.straightdope.com/u/SiXSwordS)\
**Post date:** [August 24, 2005, 8:57pm UTC](https://boards.straightdope.com/t/probability-theory-little-help/318460/7 "2005-08-24T20:57:18Z")

</div>

> [@ultrafilter](#):
>
> First off, a slight nitpick: If the probability of an event happening is 1/24, then the odds are 23:1  
> You’re right in thinking that the probability of getting w, x, y, z is 1/24, but 0! has nothing to do with it.

I have a lot to look over here and in the derangements link. I think I may be confusing a couple of issues. When i started though, the idea was that w,x,y,z had to be in that order. I pictured a nail driving them into the table. No card can “move.”

Next, I thought, if one card has no nail, it can move, then You have 1!.

If none can move, then you must have zero.

Tahnks everyone, this is really what I was looking for.

---

<div class="post-metadata">

**Author:** ![SiXSwordS](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SiXSwordS](https://boards.straightdope.com/u/SiXSwordS)\
**Post date:** [August 29, 2005, 7:46pm UTC](https://boards.straightdope.com/t/probability-theory-little-help/318460/8 "2005-08-29T19:46:38Z")

</div>

> [@RM Mentock](#):
>
> I would have said 7, out of 24

Yes, I was off on this. Interestingly, it was figuring out _why_ I was off that helped me figure out a few things. (I also realized that _any_ two isn’t exactly what I meant. I meant {_w,x,_, **} or {** ,x,y, **} or {** ,_,y,z_}.)

Another problem that pushed me was the issue of there being nine “permutations” (I hope I’m using the right word) where no card is in the right place. If there are 24 total - 9 “incorrect” then there are 15 permutations (24 - 9 = 15) where at least one card is in the ‘right’ place.

I couldn’t find any cite, so the only thing I can do is to try to reproduce my ‘fingers-and-toes.’ I apologize in advance for my banality. I really am trying to learn this stuff.

> [@ultrafilter](#):
>
> You’re right in thinking that the probability of getting w, x, y, z is 1/24, but 0! has nothing to do with it.

I think 0! has a lot to do with it and this is why:

First, I decided to write out all the permutations of {_w,x,y,z_}. I made a chart with four column titles: _w_ (3!), _x_ (3!). _y_ (3!). _z_ (3!). Each card can be the first card leaving (3) cards that can be in any order.  
The rows I simply number 1-6 because (3!) = 6. There are four cards, six permutations each, 6 \* 4 = 24.

Next, I highlighted those nine permutations with no card in the right position. It was a little surprising to note that none of the nine were in the first column until I realized that the first column is {_w,_,\*,\*\*} so every permutation there definitely has one card in the right position: {_w1_}.

I then physically checked the remaining permutations. All fifteen have at least one card in the right position: {_w1, x2, y3, z4_} where the subscript, in this case, indicates the position of the card.

The difference between the sets: {_w,x,y,z_} and {_w1,x2,y3,z4_} is that {_w1,_,_, **} accounts for certain permutations in {** ,x2,_, **}, namely {_w1,x2,_,** }, and likewise for {_y3_} etc.

If, instead of physically finding those permutations that have already been used, one counts the permutations where {_w,x,y,z_} = (0!) and {_w,x,y, **};{** ,x,y,z_};{_w,_,y,z\*};{_w,x,_,z\*} = (1!) etc. ( using factorial for the number of “holes” or “wild-cards”) then the logically equivalent permutations can be subtracted.

In that case, one can use the equation: ((3!) + (3!-2!) + (3! - (2! + 1!) + (3! - (2! + 1! + **0!** )) = 15. This is the same as: {_w,_,_,**} + ({**,x,_, **} - {_w,x,_,** }) + ({ **,\*,y,** } - ({_w,_,y, **} + {\*w,x,y,** })) + ({\*\*,_,_,z\*} - ({_w,_,_,z_} + {_w,_,y,z\*} + {_w,x,y,z_})).  
I hope I got all the () and {} in the right places.

I haven’t gotten that far yet, but I think this can be used with larger sets and other “combinations” as well. (e.g.: {_w,x,_, **} or {** ,x,y, **} or {** ,_,y,z_} → 2! + (2! - 1!) + (2! - 0!) = 4. (I checked this answer against the chart and there are 4 permutations that fit the criteria.)

Sorry it took me so long to get all of this together and posted.  
I thought it made more sense to post in this thread rather than start a new one.
