Thursday, December 4, 2014

Permutations & Combinations

The use of permutations and combinations is vast in general. Many a questions entertaining complex logics are asked to check a person's thinking capability. This is the only section which requires maximum presence of mind and maximum common sense. So, be alert while learning these concepts.

                                                                                                                

Let’s first talk about ways of doing things.

Let’s say, I have to choose an alphabet. In how many ways can I chose?
  • The ans is 26 ways, because there are 26 alphabets.

Okay. In how many ways can I chose a vowel?
  • The ans is 5 ways, because there are 5 vowels only.

 Okay. In how many ways can I chose a consonant?
  •  The ans is 21 ways, because there are 21 consonants only.

 So far, so good. But if the question is altered to, let’s say, in how many ways I can select a vowel and a consonant from all alphabets?

To do this, we have to think like this.

If I select vowel 'a', then selecting consonants 'b, c, d, f....' will have 21 ways
Similarly, if I select vowel 'e' then selecting consonants 'b, c, d, f...' again will have 21 ways.
Similar 21 ways when I select 'i', 'o' and 'u'.
So, there are a total of 5*21 = 105 ways.

If I had proceeded selecting consonant first and then vowel later, then again I would have got 21*5 = 105 ways.

So, we would say, if I have 5 ways of selecting one vowel, and 21 ways of selecting one consonant, then I have 5*21 ways of selecting both vowel and consonant together.
                                                                                                                
Now let’s do a common sense question.

Ques: In how many ways India’s team captain and vice-captain be elected from a team of 12 men?

To do this, if captain is elected first, then we have 12 ways of doing this.
For election of vice-captain, we have only 11 ways left, coz 1 way is already consumed. (Situations like this is called dependent situation. One selection depends upon other selection.)
  • So, the ans is 12*11 = 132 ways.

Questions like these requires more common sense.
                                                                                                                
Let’s do this question now.

Question: How many even numbers less than 10000 can be formed with the digits 3, 5, 7, 8, 9 without any repetition?

To do this, first think what an even number is?
Ans: An even number is that number whose unit digit is 0, 2, 4, 6, or 8.
In this question, there is only one digit which is an even number. Which is ‘8’. So, we place this 8 at unit's digit.

Now, less than 10000, there can be one digit numbers, two digit numbers, three digit numbers and four digit numbers.

(a) One digit number.

There can only be one 'one digit number'. i.e. 8. Hence, only 1 way of making one digit even number.

(b) Two digit number.

For placing 8 at unit's place we have 1 way. For placing a digit at ten's place we have 4 ways (we have 3, 5, 7, and 9). Hence total 1*4 = 4 ways of making a two digit even number.

(c) Three digit number.

Placing 8 at unit's place we have 1 way. For placing a digit at ten's place we have 4 ways (we have 3, 5, 7, and 9). But now, for placing a digit at hundred's place, we have only 3 ways (since one digit out of 3, 5, 7, and 9 is consumed at ten's place). Hence, total 1*4*3 = 12 ways of making a three digit even number.

(d) Four digit number.

For Placing 8 at unit's place we have 1 way. For placing a digit at ten's place we have 4 ways (we have 3, 5, 7, and 9). Now, for placing a digit at hundred's place, we have only 3 ways (since one digit out of 3, 5, 7, and 9 is consumed at ten's place). And for placing a digit at thousand's place, we have only 2 ways. Thus, total of 1*4*3*2 = 24 ways of making a four digit even number.
  • Hence, total of 1 + 4 + 12 + 24 = 41 ways.
                                                                                                                

Don’t go further before understanding all the above!!

                                                                                                                
A question: Why we hadn't formed a five digit even number in the previous question?
                                                                                                                
Always remember these two things:

1. For arrangement of things, we uses permutations

2. For selection of things, we uses combinations.
                                                                                                                 
Let’s say we have three letters A, B, C and we have to arrange two letters at a time, in how many ways this can be done?
  • We can make AB, AC, BA, BC, CA, CB = 6 ways.
 This is called permutation.
But in combination we could have only made AB, AC, BC, hence 3 ways.

In permutation, the order of things is not considered. But combinations, it is considered. I.e. in combination, AB and BA means the same thing, etc.
                                                                                                                
 First we will do permutations.
                                                                                                                

The formula of permutations of 'n' different things taken 'r' at a time is

nPr = n! / (n-r)!

means to say, if we have 3 letters (A, B, C) and we take 2 letters (like AB, AC, etc.) at a time ==> ways = 3P2 = 3!/(3-2)! = 3!/1! = 6 ways

n! means 'n' factorial.

Factorial comes out of the dependence events. (Recall the team captain question, we had have 12 ways of selecting 1st person, 11 ways of selecting 2nd, etc.)
                                                                                                                

Ques: In how many ways the letters of the word HONEY be arranged?

HONEY has 5 letters.

To arrange the first letter, we have 5 ways
To arrange the second letter, we have 4 ways (because one letter is already selected)
To arrange the third letter, we have 3 ways
To arrange the fourth letter, we have 2 ways
And To arrange the fifth letter, we have 1 way
  • Thus total 5*4*3*2*1 ways = 120 ways
 And this is where this Factorial thing came from.

5! = 120

If we had letter SHAKTI, we had had 6! = 720 ways of arranging the letters.
                                                                                                                 
Now let’s face these basic questions!
                                                                                                                

Ques: In how many ways the letters of the word TOO be arranged?

In this, 'O' is repeated. So initially there we had 3! = 6 ways, but due to this repetition, we are down to 6/2 = 3 ways only.
  • I.e. words are TOO, OTO, OOT only can be formed.
If we had had three different letters, like TOE, we had 6 arrangements: TOE, TEO, OTE, OET, ETO, and EOT.

Repetition of letters lessens the ways of arrangement. The more the repetitions, the lesser are the ways.
                                                                                                                

Ques: In how many ways the letters of the word LOOK be arranged?

In this four letters means 4! = 24 ways
  • But 'O' is repeated two times.
 And thus we divide the final ways by 2. I.e. there are only 24/2 = 12 ways of arranging the letters of this word.

LOOK, LOKO, LKOO, KOOL, KOLO, KLOO, OOLK, OOKL, OLOK, OKOL, OLKO, OKLO = 12 Ways
                                                                                                                

The number of permutations of 'n' things taken all at a time of which 'p' are similar of one kind, 'q' are similar of second kind, etc., then we have

Permutations = n! / (p!*q!)
                                                                                                                

 Ques: In how many ways can the letters of the word RESPECT be arranged?

RESPECT has 7 words, but E is repeated two times. Thus ways = 7! / 2! = 2520 ways
                                                                                                                
 Ques: In how many ways letters of the word RECUPERATE be arranged?

RECUPERATE has 10 letters, out of which E repeated 3 times, R repeated 2 times. Hence total ways = 10! / (3!*2!) = 302400 ways
                                                                                                                
Read all this before we go further doing some advanced type of questions...
                                                                                                                

Let’s face a complex question. This question will clear many more concepts.
                                                                                                                

Ques: In how many ways the letters of the word RAINBOW be arranged?

Also, in the arrangement

(1) How many words begin with R?
(2) How many words begin with R and ends with W?
(3) How many words are there in which R and W are at the end positions?
(4) How many words are there in which N and B are together?
(5) How many words are there in which I and O are never together?
(6) How many words are there in which vowels are never together?
(7) How many words are there in which vowels are always before consonants?
(8) How many words are there in which first and last letters are vowels?
(9) If arrangements formed are arranged in dictionary form, then what is the position of the word RAINBOW in that dictionary?

                                                                                                                

Total ways of arranging the letters = 7! = 5040 ways.

(1) When R is fixed at initial, then we have only 6 letters left to arrange the word. Total ways = 6! = 720 ways

(2) When now R is fixed at initial, and W is fixed at the end, we have only 5 letters left to arrange the word. Total ways = 5! = 120

(3) When we have R and W at initial and end, we can arrange the word in 120 ways. In a similar way, 120 ways are there when W is at initial and R is at end. SO a total of 120+120 = 240 ways are there for this question.

(4) Assume N and B stick together as one letter, we have 6 letters for the arrangement. (R, A, I, NB, O, W) which can be arranged in 6! ways = 720 ways

But NB can also be mutually arrange in two ways (NB and BN)

Total final ways of arranging the word = 6!*2! = 1440 ways

(5) If I and O are together, then the number of ways of arranging = 1440 ways --- [see (4)'s explanation]

Out of total permutations of 5040 ways, 1440 ways are there in which I and O are together. Remaining will be the ones in which I and O are not together.

I and O not together = 5040-1440 = 3600 ways

(6) There vowels are there: A, I, O

Either vowel can initiate the word (like ARINBOW) or a consonant can initiate the word (like RAINBOW)

Either vowel can end the word (like RAINBWO) or a consonant can end the word (like RAINBOW)

For vowels to not come together, they must come in between consonants. When 4 consonants are arranged, this leaves five places for three vowels to fill

_C_C_C_C_

C = consonant
_ = vowel

Thus, 5 places can be filled by 3 vowels in = 5P3 = 5!/2! = 60 ways
And four places of consonants can be filled in = 4! = 24 ways
  • Total ways = 60*24 = 1440 ways
(7) Let’s combine vowels AIO as one letter and consonants RNBW as one letter, giving AIO, RNBW as two letters

These two letters can be arranged in 2 ways

i.e. 'AIO'RNBW' or 'RNBW'AIO'

But vowels come before consonants. Thus, there is only one way of doing this.

And also, Vowels can mutually arrange in 3! = 6 ways

And consonants can mutually arrange in 4! = 24 ways

Thus, total ways = 1*6*24 = 144 ways

(8) 3 vowels are there. First and last (two places) can be filled by these 3 vowels in = 3P2 = 3!/1! = 6 ways

And remaining letters (4 consonants, 1 vowel = 5 letters) can be arranged in 5! ways
  •  Total 6*5! = 720 ways
(9) In dictionary, A comes before B and B comes before C and so on.  Let’s arrange the letters in word RAINBOW
  •  Ascending order ==> ABINORW
If 1st letter = 'A', the number of words beginning with A = 6! (There are 6 letters left to arrange)

Similarly, number of words beginning with 'B' = 6!

With 'I' = 6!
With 'N' = 6!
With 'O' = 6!
With 'RAB' = 4! (When we begin with R, A will automatically come next to R in dictionary and B will come next to A. So, we'll begin with RAB)
With 'RAIB' = 3! (When arrangements of RAB is finished, arrangements of RAI begins, and B comes next to RAI. So, RAIB)

The next letter with RAIN will be RAINBOW
  • RAINBOW will come after = 5*6! + 4! + 3! = 3630th places. I.e. RAINBOW will come at 3631's place.
 For more clarification, the letters arranged with RAIN as first letters will 3! = 6 ways = RAINBOW, RAINBWO, RAINOBW, RAINOWB, RAINWBO, RAINWOB

                                                                                                                
Understand all these before I give a question to solve.
                                                                                                                
Do this question!                                                                                                                

There are three copies of each of 4 different books. In how many ways can they be arranged on the shelf?

Ans: 3 copies of 4 books ==>total 12 books. = 12! ways
But all these four different books are repeated 3 times.
  • Total ways = 12! / (3!*3!*3!*3!) = 12! / 6^4 = 369600 ways
                                                                                                                 
There are also cases of circular permutations.

For example, forming rings, sitting in circles, forming garlands, necklaces, etc.

In circular permutations, there is no end point. 1st thing comes with second thing and also the last thing. So, to do this, one thing is kept fixed, and remaining things are arranged.

To say, circular permutation of 'n' objects will be = 1 kept fixed and (n-1) objects arranged in (n-1)! ways

Example: in how many ways 7 members can be arranged in circle?
  • Fix one, and arrange rest in 6! ways = total ways of arrangement = 6! = 720 ways
                                                                                                                
In garlands, necklace, etc., we have all the objects similar. In these type of permutations, there is no difference between clockwise and counter-clockwise permutations. So, Final ways will be half of the total ways (n-1)! / 2

Example: in how many ways 5 beats can be strung into a necklace?
  • Ans is (5-1)! / 2 = 4!/2 = 12 ways
                                                                                                                                                                   
Do this Question!

Ques: in how many ways can 5 men and 2 women be arranged at a round table if two women are never together?

Total ways of arranging 7 person in a circle = 6! = 720 ways

If we consider two women as one, then we have 5+1=6 persons. Arranging these six persons in circle will take = 5! = 120 ways

And two women can arrange themselves in 2! ways
  •  Total ways in which two women sit together in circle = 5!*2! = 240 ways
  •  Total ways in which two women doesn’t sit together in circle = 6! - 5!*2! = 720 - 240 = 480 ways
                                                                                                                
Always Remember

When we have to arrange things, Permutations is used.
But when we have to select things, Combinations is used. 
                                                                                                                
 Now we'll do Combinations
                                                                                                                
Combinations is all about selection.

Let’s say, in how many ways A, B, C can be arranged, taking two at a time?

Ans will be 6 ways: AB, AC, BA, BC, CA, and CB. This is permutation.
But when we talk about selection, we can select AB or BC or CA only. Because when we make selection (selection of A and B together, for example) their order is ignored. Means to say, selecting A and B or selecting B and A means the same thing. And same goes for BC and CA.
                                                                                                                
In a similar vein, the combinations of A, B, C, D taken three letters at a time will be

ABC, ABD, ACD, BCD = only for way of selection.

But in permutations, selecting 3 letters at a time out of 4 letters gives = 4P3 = 4! / (4-3)! = 24 ways.
                                                                                                                
From the above examples, we observed that:
  • Three letters, taken two at a time; permutation = 6 ways, combination = 3 ways
  • Four letters, taken three at a time; permutation = 24 ways, combination = 4 ways
Formula for Permutation was nPr = n! / (n-r)!

Formula for Combination is nCr = n! / (n-r)!*r!
In Combinations, we have one more [r!] in the denominator.
                                                                                                                

You’ll understand this relation better after you do these questions.

Ques (1): In how many different ways 5 members be arranged out of 6 gentlemen and 4 ladies?

Ans: 10P5 = 10! / (10-5)! = 30240 ways

Ques (2): How many different committee of 5 members may be formed from 6 gentlemen and 4 ladies?

Ans: 10C5 = 10! / (10-5)!*5! = 252 ways
And these 5 members selected can arrange themselves in 5! Ways
  • Total arrangements = 252*5! = 30240 ways
And this is all the relation between Permutations and Combinations.
                                                                                                                
Understand all this before you read further....
                                                                                                                 

Ques: A committee of 5 members has to be formed from a group of 6 gentlemen and 4 ladies. In how many ways can this be done if the committee is to be included at least one lady?

5 persons can be selected as given below:

(a) 1 lady out of 4 ladies + 4 gentlemen out of 6 gentlemen
(b) 2 ladies out of 4 ladies + 3 gentlemen out of 6 gentlemen
(c) 3 ladies out of 4 ladies + 2 gentlemen out of 6 gentlemen
(d) 4 ladies out of 4 ladies + 1 gentlemen out of 6 gentlemen

Selection of (a) can be done in 4C1*6C4 = 60 ways
Selection of (b) can be done in 4C2*6C3 = 120 ways
Selection of (c) can be done in 4C3*6C2 = 60 ways
Selection of (d) can be done in 4C4*6C1 = 6 ways

Total ways = 60+120+60+6 = 246 ways = Answer
                                                                                                                
Ques: A question has two parts, Part A and Part B, each containing 8 questions. If the student has to choose 6 from Part A and 5 questions from Part B, in how many ways can he choose the questions?

Ans: 6 questions from 8 questions in Part A can be selected in 8C6 ways
5 questions from 8 questions in Part B can be selected in 8C5 ways
  • Total ways of choosing 6 from Part A and 5 from Part B = 8C6 * 8C5 = 28*56 = 1568

No comments: