In how many ways can you select two balls out of available five identical green balls

Introduction

Probability is the likelihood or chance of an event occurring.

Probability =  the number of ways of achieving success
   the total number of possible outcomes

For example, the probability of flipping a coin and it being heads is ½, because there is 1 way of getting a head and the total number of possible outcomes is 2 (a head or tail). We write P(heads) = ½ .

  • The probability of something which is certain to happen is 1.
  • The probability of something which is impossible to happen is 0.
  • The probability of something not happening is 1 minus the probability that it will happen.

This video is a guide to probability. Expressing probability as fractions and percentages based on the ratio of the number ways an outcome can happen and the total number of outcomes is explained. Experimental probability and the importance of basing this on a large trial is also covered.

Single Events

Example

There are 6 beads in a bag, 3 are red, 2 are yellow and 1 is blue. What is the probability of picking a yellow?

The probability is the number of yellows in the bag divided by the total number of balls, i.e. 2/6 = 1/3.

Example

There is a bag full of coloured balls, red, blue, green and orange. Balls are picked out and replaced. John did this 1000 times and obtained the following results:

  • Number of blue balls picked out: 300
  • Number of red balls: 200
  • Number of green balls: 450
  • Number of orange balls: 50

a) What is the probability of picking a green ball?

For every 1000 balls picked out, 450 are green. Therefore P(green) = 450/1000 = 0.45

b) If there are 100 balls in the bag, how many of them are likely to be green?

The experiment suggests that 450 out of 1000 balls are green. Therefore, out of 100 balls, 45 are green (using ratios).

Multiple Events

Independent and Dependent Events

Suppose now we consider the probability of 2 events happening. For example, we might throw 2 dice and consider the probability that both are 6's.

We call two events independent if the outcome of one of the events doesn't affect the outcome of another. For example, if we throw two dice, the probability of getting a 6 on the second die is the same, no matter what we get with the first one- it's still 1/6.

On the other hand, suppose we have a bag containing 2 red and 2 blue balls. If we pick 2 balls out of the bag, the probability that the second is blue depends upon what the colour of the first ball picked was. If the first ball was blue, there will be 1 blue and 2 red balls in the bag when we pick the second ball. So the probability of getting a blue is 1/3. However, if the first ball was red, there will be 1 red and 2 blue balls left so the probability the second ball is blue is 2/3. When the probability of one event depends on another, the events are dependent.

Possibility Spaces

When working out what the probability of two things happening is, a probability/ possibility space can be drawn. For example, if you throw two dice, what is the probability that you will get: a) 8, b) 9, c) either 8 or 9?

In how many ways can you select two balls out of available five identical green balls

a) The black blobs indicate the ways of getting 8 (a 2 and a 6, a 3 and a 5, ...). There are 5 different ways. The probability space shows us that when throwing 2 dice, there are 36 different possibilities (36 squares). With 5 of these possibilities, you will get 8. Therefore P(8) = 5/36 . b) The red blobs indicate the ways of getting 9. There are four ways, therefore P(9) = 4/36 = 1/9.

c) You will get an 8 or 9 in any of the 'blobbed' squares. There are 9 altogether, so P(8 or 9) = 9/36 = 1/4 .

Probability Trees

Another way of representing 2 or more events is on a probability tree.

Example

There are 3 balls in a bag: red, yellow and blue. One ball is picked out, and not replaced, and then another ball is picked out.

In how many ways can you select two balls out of available five identical green balls

The first ball can be red, yellow or blue. The probability is 1/3 for each of these. If a red ball is picked out, there will be two balls left, a yellow and blue. The probability the second ball will be yellow is 1/2 and the probability the second ball will be blue is 1/2. The same logic can be applied to the cases of when a yellow or blue ball is picked out first.

In this example, the question states that the ball is not replaced. If it was, the probability of picking a red ball (etc.) the second time will be the same as the first (i.e. 1/3).

This video shows examples of using probability trees to work out the overall probability of a series of events are shown. Both independent and conditional probability are covered.

The AND and OR rules (HIGHER TIER)

In the above example, the probability of picking a red first is 1/3 and a yellow second is 1/2. The probability that a red AND then a yellow will be picked is 1/3 × 1/2 = 1/6 (this is shown at the end of the branch). The rule is:

  • If two events A and B are independent (this means that one event does not depend on the other), then the probability of both A and B occurring is found by multiplying the probability of A occurring by the probability of B occurring.

The probability of picking a red OR yellow first is 1/3 + 1/3 = 2/3. The rule is:

  • If we have two events A and B and it isn't possible for both events to occur, then the probability of A or B occuring is the probability of A occurring + the probability of B occurring.

On a probability tree, when moving from left to right we multiply and when moving down we add.

Example

What is the probability of getting a yellow and a red in any order? This is the same as: what is the probability of getting a yellow AND a red OR a red AND a yellow. P(yellow and red) = 1/3 × 1/2 = 1/6 P(red and yellow) = 1/3 × 1/2 = 1/6

P(yellow and red or red and yellow) = 1/6 + 1/6 = 1/3

A combination is a selection of r items from a set of n items such that we don't care about the order of selection.

Examples of Combinations

Combinations without repetitions

Let's say that we wanted to pick 2 balls out of a bag of 3 balls colored red (R), green (G) and purple (P). 123
How many unique combinations will we have if we cannot repeat balls?


3 different ways. Our options are: RG, RP and GP.
12 13 23

We can count the number of combinations without repetition using the nCr formula, where n is 3 and r is 2.

# combinations =n!=3!=6= 3
(n-r)!r!2!*1!2


We can see examples of this type of combinations when selecting teams for a sports game or for an assignment. We cannot select a team member more than once (so we can't have a team with Danny, Danny and myself) and we do not care about who is selected first to the team (so if I am in a team with Bob and Tom it is the same to me as being in a team with Tom and Bob).

Combinations with repetitions

Let's say that we wanted to pick 2 balls out of a bag of 3 balls, colored red (R), green (G) and purple (P) 123
If each time we select a ball we place it back in the bag, how many unique combinations will we have?


6 different ways. Our options are: RR, RG, RP, GG, GP and PP.
11 12 13 22 23 33


We can count the number of combinations with repetitions mathematically by using the combinations with repetitions formula where n = 3 and r = 2.

# combinations =(n+r-1)!=4!=24= 6
(n-1)!r!(3-1)!2!4

We can see examples of this type of combinations when buying ice cream at an ice cream store since we can select flavors more than once (I could get two, three or even four scoops of chocolate ice cream if I wished) and I don't care about which scoop goes on top (so chocolate on top and vanilla on the bottom is the same to me as vanilla on top with a chocolate base).

Permutations Calculator

What is a permutation?

A permutation is a selection of r items from a set of n items where the order we pick our items matters.

Examples of permutations

Permutations without repetitions

Let's say that we wanted to pick 2 balls out of a bag of 3 balls colored red (R), green (G) and purple (P) 123
How many unique permutations will we have if we cannot repeat balls?

6 different ways. Our options are: RG, GR, RP, PR, GP and PG.
12 21 13 31 23 32

We can show this mathematically using the permutations formula with n = 3 and r = 2

# permutations =n!=3!=3!= 6
(n-r)!(3-2)!1!

We can see examples of this type in real life in the results of a running race (assuming that two people can't tie for the same place) as we clearly care if we come first and our competitor comes second or if it is the other way around.

Permutations with repetitions

Let's say that we wanted to pick 2 balls out of a bag of 3 balls colored red (R), green (G) and purple (P). 123
If each time we select a ball we place it back in the bag, how many unique permutations will we have?

9 different ways. Our options are: RR, RG, GR, RP, PR, GG, GP, PG and PP.
11 12 21 13 31 22 23 32 33

We can show this mathematically by using the permutations with repetitions formula with n = 3 and r = 2.
# permutations = nr = 32 = 9


We can see this in real life in the number of codes on a safe - we can repeat numbers if we want (and have a password such as 1111) and we care about the order of the numbers (so if 1234 opens the safe, 4321 will not).

Explaining the combinations and permutations formulas

How many ways do we have of ordering n balls?

If we have 3 balls colored red (R), green (G) and purple (P) then there are 6 different ways. We have 3 options for the first color, then 2 options for the second color and one choice for the last color. Therefore we have 3 * 2 * 1 different options or 3! For 4 balls, we have 4! different permutations available. For 5 balls we have 5! different options, etc. For n balls we have n! options.

Explaining the permutations formula

How many permutations are there for selecting 3 balls out of 5 balls without repetitions? We can select any of the 5 balls in the first pick, any of the 4 remaining in the second pick and any of the 3 remaining in the third pick. This is 5 * 4 * 3 which can be written as 5!/2! (which is n! / (n - r)! with n=5, r=3).
There is also an alternative way to pick a selection of 3 balls. Let's say we wanted to pick balls 123. Then we could go on to pick the remaining 2 balls too. This would give us the possible permutations 12345 and 12354. We can see that there are 2! (which is 2) different ways of selecting 5 balls if we want 123 to be the first 3 selections. Therefore, we can obtain then number of selections of 3 balls from 5 balls by dividing 5! (the total number of selections) by 2! (permutations in the list of 5! options which begin with 123, or any other 3 balls you may choose). . How many 5 ball permutations will it start? Well 2! because for this selection you have two balls left and they can be arranged in 2! different ways (as we saw above). Therefore to get the number of permutations of 3 balls selected from 5 balls we have to divide 5! by 2!.

Explaining the combinations formula

Each combination of 3 balls can represent 3! different permutations. Therefore, we can derive the combinations formula from the permutations formula by dividing the number of permutations (5! / 2!) by 3! to obtain 5! / (2! * 3!) = 10 different ways. This generalises to other combinations too and gives us the formula #combinations = n! / ((n - r)! * r!)

Explaining permutations with repetitions formula

If we again picked 3 out of 5 balls but with repetitions then we have 5 options for each selection, giving us 5 * 5 * 5 = 125 selections overall. The general formula is therefore #permutations = nr.

Explaining combinations with repetitions formula

Let's see how many combinations there are for selecting 3 balls out of 5 (red (R), green (G), purple (P), turquoise (T) and yellow (Y)) with repetitions. You will notice that our trick from the normal combinations formula does not work. For example, if we look at the combination of two red balls and one green ball only has 3 possible permutations (RGG, GRG, GGR) instead of 3! = 6, since the green appears twice. Therefore we cannot just divide the number of permutations by 6! and be done. Instead we will use a nice representation to make our task easier. We can represent selections in a table so if we wanted to select 2 reds and a green ball we might note it as: R | G | P | T | YOO | O | | |Which can be written more compactly, by omitting the header and unnecessary spaces, as OO|O|||and selecting one green, one purple and one yellow ball can be written as:R | G | P | T | Y| O | O | | Owhich can be written more compactly as |O|O||OFinally, selecting 3 turquoise balls can be written in a table like this:R | G | P | T | Y| | | | OOOwhich can be written as ||||OOO

Each string of 4 |'s and 3 O's corresponds to a selection and vice versa. Therefore the number of ways of selecting 3 balls out of 5 with repetition and where order matters is the same as the number of ways of writing strings from 4 |'s and 3 O's. To figure out how many of these there are, we can start from 7! and then see that we need to divide by 4! because we repeat strings 4! because of | repetition (since initially we treat the 4 |'s as separate symbols) and divide by 3! since we repeat strings 3! times because of O repetition. Therefore there are 7!/(4!3!) different combinations = (n + r - 1)! / ((n - 1)! * r!), which is the formula that we are after.

Combinations versus permutations, what's the difference?

The difference is whether we care about the order. With combinations, the order does not matter. If we had to pick a sports team then the order in which we pick players does not matter. If we do care about the order then we are choosing a permutation. If instead of a sports team we looked at the results of a running race then order becomes important. We do care if we come first and our main contender comes second or vice versa, even though these would be part of the same combination.

How to use the combinations and permutations calculator?

Order is important: defines whether you want to use the combinations calculator (when it's not active) or the permutations calculator (when it's active).

With repetitions: allows you to select combinations and permutations with repetitions (active) or without (inactive).
This is relevant both the combinations calculator and the permutations calculator.

Identical items: allows you to specify if your problem has some repetitions of items but not infinite replacement (active) or whether it does not (inactive). When it's active, you can fill in the number of repetitions for each item. Note that in this case the number of items textbox will represent the number of unique items.
The identical items switch is relevant both to the combinations calculator and the permutations calculator.