0

First of all, I apologize if this question is considered "stupid", but I don't even know what term to search for in English to find an answer to my problem, I've tried googling it and searching here but to no avail. The questions I found were sort of related, but not exactly the same problem so I found no relevant information.

My question is: If I have a certain amount of items that can create combinations with each other, but not with a copy of itself, how would i put that into a formula?

Example: I get to pick two flavors out of strawberry, chocolate or vanilla ice cream, but I do not get two scoops of the same flavor.

The answer to this is fairly simple if I'm talking about it in a conversation, but I can't for the life of me put it in a formula that I could get for example a calculator to understand. On top of that I'd like to know how to calculate this fairly easily if the numbers reach two or even three digits.

Once again, apologies if I've overlooked an available answer, no idea what to search for, if the answer is available here already (with a formula shown in said answer), feel free to refer me to that instead of writing a fresh one.

  • The number of ways to choose $k$ items out of $n$ equals $\frac{n!}{k!(n-k)!}$. Have a look here: https://en.wikipedia.org/wiki/Combination. – jvdhooft Jun 28 '17 at 19:37
  • What you are asking for is amount of UNIQUE combinations, which is a bit harder than "number of combinations", which allows for repeats. – iammax Jun 28 '17 at 19:37
  • Of course, I completely forgot to specify that in the title, my head was completely wrapped up in trying to make sure I got the question properly formulated. Thank you. – AndyNoYume Jun 28 '17 at 19:39

1 Answers1

0

There is theory dedicated to the art of counting. Take a look at https://www.probabilitycourse.com for a primer. Specifically the bottom of this page lists the formulae to use in the event that you are looking at an ordered problem or not, and whether you are sampling with or without replacement.

For this question, let n be your 3 flavours and k be your two unique choices. This is a unordered problem, without replacement. $$\frac{n!}{k!(n-k)!}=3$$

edit: for clarification a factorial of n is the multiplication of every number from 1 up to and including n. $5!=1\times 2 \times 3 \times 4 \times 5$. Also, formally, 0! =1.

further explanation:

$$\binom{n}{k}=\frac{n!}{k!(n-k)!}=\binom{n}{n-k}$$ This can be seen from the symmetry of the equation in the middle.

Now to address the case $\binom{14}{2}=91=\frac{14 \times 13}{2}$ as requested in the comments. Write it out on paper, I'll abbreviate with ...s. $$\frac{14 \times 13 \times 12 \times ... \times 2 \times 1}{(2 \times 1)(12 \times 11 \times ...\times 2 \times 1)}$$ See how the $(n-k)! = 12 \times 11 \times ... 2 \times 1$? Notice that is also in the numerator, as part of the $14!$? Well that lot cancels out. leaving $\frac{14\times13}{2}$. Let's look at it algebraically. $$n!=n \times (n-1)!=n \times (n-1) \times (n-2)!=.....=n \times (n-1) \times (n-2) \times ... \times 2 \times 1$$

Now let's apply this to your query by cancelling out the (n-k)!: $$\binom{n}{k}=\frac{n\times(n-1)\times (n-k+1)}{k!}$$ Well you have sated n=14 and k=2, so your (n-k+1) value will equal (14-2+1)=13. So you will multiply every number from 13 until your n value, which here is 14. $$\binom{14}{2}=\frac{14 \times (14-1)}{2!}$$

DWD
  • 625
  • 6
  • 15
  • As I'm not very well versed in math, and don't quite understand factorials and such, I used an online calculator to find an answer, and then tried to replicate that answer using a normal, very limited, calculator. My numbers were n =14, k =2, and to my understanding this equals 91 unique combinations. I got this answer on a normal calculator by using 14x13 = 182, 182/2 = 91. However I'm still curious to why n x n-1 / k works the same way. Could this be explained in simple layman terms, or is that something that should be a separate question? – AndyNoYume Jun 28 '17 at 20:29
  • @AndyNoYume I have added a lot of detail so you can review it – DWD Jun 28 '17 at 20:43
  • @AndyNoYume There is a button on scientific calculators which looks like nCr. If you type a value, press that button (you might have to press shift or 2nd before pressing it) and then your second value you can calculate it on a hand held calculator. Here you'd press 14 nCr 2 = – DWD Jun 28 '17 at 21:05