This combination calculator (n choose r calculator) is a tool that helps you not only determine the number of combinations in a set (often denoted as nCr), but it also shows you every single possible combination (permutation) of your set, up to the length of 20 elements. However, be careful! It may take even a couple of seconds to find such long terms for our combination generator. If you wonder how many different combinations can be possibly made of a specific number of elements and sample size, try combination calculator now!
If you're still not sure what is a combination at all, we explain it in detail in the following article. You'll find here a combination definition together with the combination formula (with and without repetitions). We'll show you how to calculate combinations and what are the linear combination and combination probability. Finally, we will talk about the relation between permutation and combination. Briefly, permutation takes into account the order of the members and combination does not. You can find more information below!
Have you ever wondered what are your chances for winning the main prize in a lottery? How probable is winning the second prize? To answer both and similar questions, you need to use combinations. We've got a special tool dedicated to that kind of problems. Our lottery calculator doesn't only estimate combination probability of winning any lottery game, but also provides a lottery formula. Try it! You'll find out how big (or small) those numbers are in fact. You might also be interested in a convenient way for writing down very long numbers called scientific notation. For example,
145,000,000,000 you can write as
6.43*10⁻⁷. Isn't it simpler? For more information check the scientific notation rules.
What is a combination? - combination definition
Combination definition says that it is the number of ways in which you can choose r elements out of a set containing n distinct objects (that's why such problems are often called "n choose r" problems). The order of choosing the elements is not essential as opposed to the permutation (you can find an extensive explanation of that problem in the permutation and combination section).
Seeking for every combination of a set of objects is a purely mathematical problem. You probably have been taught e.g. how to find the greatest common factor (GCF) or how to find the least common multiple (LCM). Well, a combination is an entirely different story. Let's see how complicated it might be.
Imagine a bag filled with twelve balls, each one of a different color. You pick five balls at random. How many distinct sets of balls can you get? Or, in other words, how many different combinations can you get?
How to calculate combinations? - combination formula
Mathematicians provide the exact solution for many various problems, e.g., to how to calculate square footage or how to calculate volume. Is there a similar approach in estimating the number of combinations in the above example with balls?
Luckily, you don't have to write down all of the possible sets! How to calculate the combinations, then? You can use the following combination formula that will allow you to determine the number of combinations in no time:
C(n,r) = n!/(r! * (n-r)!),
C(n,r)is the number of combinations,
nis the total number of elements in the set,
ris the number of elements you choose from this set.
The exclamation mark
! represents a factorial. Check out our factorial calculator for more information on this topic. The expression on the right-hand side is also known as the binomial coefficient. We also use it in our other statistics calculator called the binomial distribution calculator. If you visit this site, you'll find some similarities in computations - for example, that binomial calculator uses, in fact, our nCr calculator.
Let's apply this equation to our problem with colorful balls. We need to determine how many different combinations are there:
C(12,5) = 12!/(5! * (12-5)!) = 12!/(5! * 7!) = 792.
You can check the result with our nCr calculator. It will list all possible combinations, too! However, be aware that 792 different combinations are already quite a lot of to show. To avoid a situation where there are too many generated combinations, we limited this combination generator to a certain, maximum number of combinations (2000 by default). You can change it in the advanced mode whenever you want.
You can notice that according to the combinations formula, the number of combinations for choosing only one element is simply
n. On the other hand, if you have to select all the elements, there is only one way to do it. Let's check this combination property with our example. You've got the total number of objects that equals
n = 12. Every letter displayed in nCr calculator represents a distinct color of a ball, e.g., A is red, B is yellow, C is green and so on. If you choose only one element
r = 1 at once from that set, the number of combinations will be
12 - because there are 12 different balls. However, if you choose
r = 12 elements, there'll be only
1 possible combination that includes every ball. Try it by yourself with n choose r calculator!
By this point, you probably know everything you should know about combinations and combination formula. If you still don't have enough, in the next sections we write more about the differences between permutation and combination (that are often erroneously considered as the same thing), combination probability and linear combination.
Permutation and combination
Imagine you've got the same bag filled with colorful balls as in the example in the previous section. Again, you pick five balls at random, but this time, the order is important - it does matter whether you pick the red ball as first or third. Let's take a simpler example where you choose three balls called R(red), B(blue), G(green). There are six permutations of this set (the order of letters determine the order of the selected balls): RBG, RGB, BRG, BGR, GRB, GBR, and the combination definition says that there is only one combination! This is the crucial difference.
By definition, permutation is the act of rearrangement of all the members of a set into some sequence or order. However, in literature we often generalize this concept, and we resign from the requirement of using all the elements from a given set. That's what makes permutation and combination so similar. This meaning of permutation determines the number of ways in which you can choose and arrange r elements out of a set containing n distinct objects. This is so-called r-permutations of n (sometimes called variations). The permutation formula is as below:
P(n,r) = n!/(n-r)!
Doesn't this equation look familiar to the combination formula? In fact, if you know the number of combinations, you can easily calculate the number of permutations:
P(n,r) = C(n,r) * r!
If you switch on the advanced mode of this combination calculator, you will be able to find the number of permutations as well.
You may wonder when you should use permutation instead of a combination. Well, it depends on whether you need to take order into account or not. For example, let's say that you have a deck of nine cards with digits from 1 to 9. You draw three random cards and line them up on the table, creating a three-digit number, e.g., 425 or 837. How many distinct numbers can you create?
P(9,3) = 9!/(9-3)! = 9!/6! = 504
Check the result with our nCr calculator! And how many different combinations are there?
C(9,3) = 9!/(3! * (9-3)!) = 9!/(3! * 6!) = 84
The number of combinations is always smaller than the number of permutations. This time, it is six times smaller (if you multiply 84 by
3! = 6, you'll get 504). It arises from the fact that every three cards you choose can be rearranged in six different ways, just like in the previous example with three color balls.
Both combination and permutation are essential in many fields of learning. You can find them in physics, statistics, finances, and of course maths. We also have other handy tools that could be used in these areas. Try this log calculator that quickly estimate logarithm with any base you want and significant figures calculator that tells what are significant figures and explain significant figures rules. It is fundamental knowledge for every person that has a scientific soul.
Permutation and combination with repetition. Combination generator
To complete our considerations about permutation and combination, we have to introduce a similar selection of items from the collection but with allowed repetitions. It means that every time after you pick an element from the set of n distinct objects, you put it back to that set. In the example with the colorful balls, you take one ball from the bag, remember which one you drew and put it back to the bag. Analogically, in the second example with cards, you select one card, write down the number which is on that card and put it back to the deck. In that way, you can have, e.g., two red balls in your combination or 228 as your permutation.
You probably guess that both formulas will get much complicated, but it's not as sophisticated as calculating the alcohol content of your homebrew beer (what, by the way, you can do with our ABV calculator). In fact, in the case of permutation, the equation gets even simpler. The formula for combination with repetition is as follows:
C'(n,r) = (r+n-1)!/(r! * (n-1)!),
and for permutation with repetition:
P'(n,r) = n^r.
In the below picture we present a summary that shows a difference between four types of selection of an object: combination, combination with repetition, permutation, and permutation with repetition. It's an example in which you have four balls of various colors, and you choose three of them. In case of selections with repetition, you can pick one of the balls several times. If you want to try with the permutations, be careful, there'll be thousands of different sets! However, you can still safety calculate how many of them are there (permutations are in the advanced mode).
Combination probability and linear combination
Let's start with the combination probability that is an essential quantity in many statistical problems (we've got the probability calculator that is all about it). An example that was pictured above should explain it easily - you pick three out of four colorful balls from the bag. Let's say you want to know what are the chances (probability) that there'll be a red ball among them. There are four different combinations, and the red ball is in the three of them. The combination probability is then:
Pr = 3/4 = 75%.
If you draw three random balls from the bag, in 75% of cases, you'll pick a red ball. To express probability, we usually use the percent sign. In our other calculator, you can learn how to find percentage if you need it.
Now, let's suppose that you pick one ball at once, then you write down which color you got and put it back in the bag. What's a combination probability that you'll get at least one red ball? This is a problem with the combination with repetition. From the picture above you can see that there are twenty combinations in the total and red ball is in ten of them, so:
Pr = 10/20 = 50%.
Is that a surprise for you? Well, it shouldn't. When you return the first ball, e.g., blue ball, you can draw it as a second and third ball too. The chances of getting red ball are thus lowered. You can do analogical considerations with permutation. Try to solve a problem with the bag of colorful balls: what is the probability that your first picked ball is red?
Let's say you don't trust us and you want to make a test. You draw three balls out of four, and you check whether there is a red ball or not (like in the first example of this section). You repeat that process three more times, and you get the red ball only in one of four cases -
25% of cases. You expected
75% in according to theory, what happened? Well, this is how probability works! There is the law of large numbers that describes the result of performing the same experiment a large number of times. If you repeat drawing, e.g., one hundred times, you'll be much closer to
What's more, the law of large numbers almost always leads to the standard normal distribution which can describe, for example, intelligence or height of people, with a so-called p-value. In the p-value calculator, we explained how to find p-value using the z-score table. This may sound very complicated, but it isn't that hard!
Have you ever heard about the linear combination? In fact, despite it have the word combination, it doesn't have much in common with what we have learned so far. Nevertheless, we'll try to explain it briefly. Linear combination is an object constructed from a set of terms by multiplying each term by a constant and adding the results. It is frequently used in, e.g., wave physics to predict diffraction grating equation or even in quantum physics because of the de Broglie equation. Here, you can see some common examples of linear combination:
- Vectors. Every vector in 3D can be decomposed into three unit vectors
e₁ = (1,0,0),
e₂ = (0,1,0)and
e₃ = (0,0,1). For example,
v = (2,5,3) = 2e₁ + 5e₂ + 3e₃and that's linear combination.
- Functions. Let's say you've got two functions
f(x) = eˣand
g(x) = e⁻ˣ. From those two functions you can create linear combinations that describe hyperbolic sine
sinh(x) = f(x)/2 - g(x)/2or cosine
cosh(x) = f(x)/2 + g(x)/2. You can do a similar thing with the normal sine and cosine, but you need to use the imaginary number
i. We write about it more in the last section of the square root calculator.
- Polynomials. For example, you've got three polynomials
p₁(x) = 1,
p₂(x) = 3x + 3,
p₃(x) = x² - x + 1and you want to express the function
q(x) = 2x² + x + 3as a linear combination of those polynomials. It's not always possible to do so, but in this case
q(x) = -2p₁(x) + p₂(x) + 2p₃(x).