The Wayback Machine - https://web.archive.org/web/20240927183207/https://www.geeksforgeeks.org/combination-permutation-practice-questions/
Open In App

Permutation and Combination Practice Questions | Set 1

Last Updated : 17 Sep, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Permutations and combinations (PnC) are fundamental concepts in combinatorics used to count arrangements and selections of objects.

  • Permutations refer to the different ways of arranging a set of items where order matters. For example, the arrangement of letters in a word or the order of runners finishing a race.
  • Combinations, on the other hand, involve selecting items from a group without regard to the order of selection. This is used when the arrangement of items does not matter, such as choosing team members from a group.

Permutation and Combination Practice Questions

1. n students appear in an examination, find the number of ways the result of the examination can be announced.

Answer is 2n Examples: Input : n = 6 Output : Each student can either pass or fail in the examination. so ,there exists 2 possibilities for each of the 6 students in the result. hence total number of ways for the result=(2)6 Input : n = 8 Output :(2)8=256

2. ‘n’ matches are to be played in class a chess tournament, find the number of ways in which their results can be decided

Answer is (3)n ways Examples: Input : n = 3 Output: The results of each of the 3 matches can be three ways namely win ,draw or loss since total no. of ways in which results of 3 matches can be decided =(3)3 Input: 6 Output:(3)4=81

3. A badminton tournament consists of ‘n’ matches. (i) Find the number of ways in which their results can be forecasted are given. (ii) Total number of forecasts containing all correct results. (ii) Total number of forecasts containing all wrong results.

Answer (i) (2n) (ii) 1 (iii) 1 Examples: Input : A badminton tournament consists of 3 matches. (i) In how many ways can their results be forecast ? (ii) How many different forecasts can contain all correct results ? (iii) How many different forecasts can contain all correct results ? Output:(i) Each badminton match can be decided in only 2 ways either win or loss for a particular team so total number of ways results of 3 matches can be forecast=23=8 (ii) Results of each match can be forecast wrong in only 1 way Total no. of forecasts containing all wrong results = (13) = 1 (iii) Similarly, result of each can be forecast correct in only 1 way. total no .of forecasts containing all correct results = (13) = 1

4. Find the number of ways in which ‘n’ different beads can be arranged to form a necklace

Answer is (n-1)!/2 Examples: For example 4 beads can be arranged in following ways. ….b1 b2…….b4 ….b3 ….b1 b3…….b2 ….b4 ….b1 b4…….b3 ….b2 Since it does not matter where we place first bead. Total ways to arrange is (n – 1)!. But clockwise and anticlockwise arrangements are same, so total arrangements are (n – 1)!/2

5. There are ‘n’ questions papers, find the no, of ways in which a student can attempt one or more questions

Answer: (2n-1)ways. For example a student will solve one or more questions out of 4 questions in following ways. 1) The student chooses to solve only one question, can choose in 4C1 2) The student chooses to solve only two questions, can choose in 4C2 3) The student chooses to solve only three questions, can choose in 4C3 3) The student chooses to solve all four questions, can choose in 4C4 So total ways are 4C1 + 4C2 + 4C3 +4C4 =24-1 = 15 ways We know sum of binomial coefficients from nC0 to nCn is 2n

More Practice Questions on Permutation and Combination

Unsolved Practice Problems on Permutation and Combination

  • Problem: In how many ways can you arrange 3 books out of a set of 5 different books on a shelf?
  • Problem: From a group of 10 people, how many ways can you select a committee of 4 members?
  • Problem: A password consists of 2 letters followed by 3 digits. How many different passwords can be formed if letters and digits can be repeated?
  • Problem: How many different ways can you select 3 different fruits from a basket containing 7 different types of fruit?
  • Problem: In a class of 15 students, how many ways can you choose a president and a vice-president if the same person cannot hold both positions?

Related Articles:

FAQs on Combination and Permutation

What is the difference between permutations and combinations?

Permutations refer to the arrangement of objects where order matters, while combinations refer to the selection of objects where order does not matter.

How do I calculate permutations when some items are repeated?

Use the formula for permutations with repetition: n! / (n1! × n2! × … × nk!), where n is the total number of items and n1, n2, …, nk are the frequencies of the repeated items.

What is the formula for combinations?

The formula for combinations is C(n, r) = n! / [r! × (n – r)!], where n is the total number of items and r is the number of items to choose.

How do you solve problems involving combinations with restrictions?

First, solve for the unrestricted scenario and then subtract cases that violate the restrictions, or use direct counting methods that consider the restrictions.



Similar Reads

Permutation and Combination in Python
Python provides direct methods to find permutations and combinations of a sequence. These methods are present in itertools package. Permutation First import itertools package to implement the permutations method in python. This method takes a list as an input and returns an object list of tuples that contain all permutations in a list form. C/C++ C
4 min read
QA - Placement Quizzes | Permutation and Combination | Question 1
What is the number of possible words that can be made using the word “EASYQUIZ” such that the vowels always come together? (A) 120 (B) 720 (C) 2880 (D) 4320 Answer: (C) Explanation: The word “EASYQUIZ” has 8 letters in which “EAUI” are vowels. Since vowels always come together, we can assume “EAUI” as a single unit letter. 4+1 letter can be arrange
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 2
What is the number of possible words that can be made using the word “QUIZ” such that the vowels never come together? (B) 8 (C) 12 (D) 16 (E) 24 Answer: (C) Explanation: The word “QUIZ” has 4 letters in which “UI” are vowels. Total number of possible words = 4! Treating “UI” as a single letter we can make words in 3! ways. “UI” can be arranged in 2
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 3
How many words can be made from the word “APPLE” using all the alphabets with repetition and without repetition respectively? (A) 1024, 60 (B) 60, 1024 (C) 1024, 1024 (D) 240, 1024 Answer: (A) Explanation: The word “APPLE” has 5 letters in which “P” comes twice. If repetition is allowed, the number of words we can form = 4*4*4*4*4 = 1024. (This is
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 4
How many ways a 6 member team can be formed having 3 men and 3 ladies from a group of 6 men and 7 ladies? (A) 700 (B) 720 (C) 120 (D) 500 Answer: (A) Explanation: We have to pick 3 men from 6 available men and 3 ladies from 7 available ladies. Required number of ways =  6C3 * 7C3 = 20 * 35 = 700.Quiz of this Question
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 5
In how many ways can an interview panel of 3 members be formed from 3 engineers, 2 psychologists and 3 managers if at least 1 engineer must be included? (A) 30 (B) 15 (C) 46 (D) 45 Answer: (C) Explanation: The interview panel of 3 members can be formed in 3 ways by selecting 1 engineer and 2 other professionals, 2 engineers and 1 other professional
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 6
How many 4-digit numbers can be formed from the digits 1, 2, 3, 4, 5, 6 and 7 which are divisible by 5 when none of the digits are repeated? (A) 120 (B) 35 (C) 24 (D) 720 Answer: (A) Explanation: A number is divisible by 5 if and only if its last digit is either 5 or 0. But, 0 is not available here. So, we have to fix 5 as a last digit of 4-digit n
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 7
In how many ways can 20 boys and 18 girls make a queue such that no two girls are together? (A) 20!* 20C18 (B) 20!* 20P18 (C) 20!* 21C18 (D) 20!* 21P18 Answer: (D) Explanation: The boys will be arranged in 20! ways. Now, there are a total of 21 possible places available between boys such that no 2 girls can be placed together (alternate sequence of
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 8
There are 5 floating stones on a river. A man wants to cross the river. He can move either 1 or 2 steps at a time. Find the number of ways in which he can cross the river? (Man can't take double step from last stone). (A) 11 (B) 12 (C) 13 (D) 14 Answer: (C) Explanation: The man needs to take 6 steps to cross the river. He can do this in the followi
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 9
Out of 7 boys and 4 girls, how many queues of 3 boys and 2 girls can be formed? (A) 120 (B) 25200 (C) 24800 (D) 1440 Answer: (B) Explanation: Number of ways to choose 3 boys out of 7 = 7C3. Number of ways to choose 2 girls out of 4 = 4C2. Therefore, number of ways to choose the required groups = 7C3 * 4C2 = 35 * 6 = 210. Number of ways to arrange t
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 10
A box contains 2 red coins, 3 green coins and 4 blue coins. In how many ways can 3 coins be chosen such that at least one coin is green? (A) 16 (B) 32 (C) 64 (D) 128 Answer: (C) Explanation: There are three cases: 3 green coins 2 green coins + 1 non-green coin 1 green coin + 2 non-green coins Therefore, total number of ways = 3C3 + 3C2 * 6C1 + 3C1
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 11
Out of 6 engineers and 4 doctors, how many groups of 4 professionals can be formed such that at least 1 engineer is always there? (A) 129 (B) 109 (C) 229 (D) 209 Answer: (D) Explanation: There are four cases: 4 engineers = 6C4 = 15 3 engineers and 1 doctor = 6C3*4C1 = 20*4 = 80 2 engineers and 2 doctors = 6C2*4C2 = 15*6 = 90 1 engineer and 3 doctor
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 12
Out of 8 boys and 10 girls, how many groups of 5 boys and 6 girls can be formed? (A) 11760 (B) 25200 (C) 720 (D) 120960 Answer: (A) Explanation: Required number of ways = 8C5 * 10C6 = 56 * 210 = 11760.Quiz of this QuestionPlease comment below if you find anything wrong in the above post
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 13
In how many ways can the alphabets of the word ‘DERAIL’ be arranged so that the vowels come at the odd positions only? (A) 12 (B) 18 (C) 24 (D) 36 Answer: (D) Explanation: There are 3 consonants (D,R,L) and 3 vowels (E,A,I). There are 3 odd positions and 3 even positions: O E O E O E. Therefore, required number of arrangements = 3P3 * 3P3 = 6 * 6 =
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 14
In how many different ways can the alphabets of the word ‘SCORING’ be arranged so that the vowels always come together? (A) 120 (B) 720 (C) 240 (D) 1440 Answer: (D) Explanation: We have 5 consonants and 2 vowels. Since, the vowels must always come together, we can treat them as a single alphabet. Then, we have to arrange 6 alphabets. Number of ways
1 min read
QA - Placement Quizzes | Permutation and Combination | Question 15
The value of 75C2 is: (A) 1215 (B) 2315 (C) 2775 (D) 1675 Answer: (C) Explanation: 75C2 = 75! / (73! * 2!) = 75*74/2 = 2775.Quiz of this QuestionPlease comment below if you find anything wrong in the above post
1 min read
Permutation vs Combination - Definition, Differences, Examples
Permutation is referred to as the selection followed by an arrangement of a certain set of items from a given sequence or collection of items. Permutations are denoted by the following formula, nPr = (n!)/(n-r)!, n > 0 and r > 0 where, n is considered to be the number of different elements. r is the arrangement pattern of the element. Combina
3 min read
Permutation Groups and Multiplication of Permutation
Let G be a non-empty set, then a one-one onto mapping to itself that is as shown below is called a permutation. The number of elements in finite set G is called the degree of Permutation.Let G have n elements then Pn is called a set of all permutations of degree n.Pn is also called the Symmetric group of degree n.Pn is also denoted by Sn.The number
3 min read
Check if permutation of one string can break permutation of another
Given two strings str1 and str2, the task is to check if any permutation of the given strings str1 and str2 is possible such that the character at each index of one string is greater than or equal to the other string. Examples: Input: A = "abc", B = "xya" Output: Yes Explanation: "ayx" is a permutation of B = "xya" which can break to string "abc" w
6 min read
Minimum number of given operations required to convert a permutation into an identity permutation
Given a permutation P (P1, P2, P3, ... Pn) of first n natural numbers. Find the minimum number of operations to convert it into an identity permutation i.e. 1, 2, 3, ..., n where each operation is defined as: P[i] = P[P[P[i]]] [Tex]\forall [/Tex]i from 1 to n (1 based indexing). If there is no way to convert then print -1.Examples: Input: arr[] = {
11 min read
Minimum number of adjacent swaps required to convert a permutation to another permutation by given condition
Given a permutation P of size N, having values from 1 to N. the task is to find the minimum number of adjacent swaps required such that for all i in the range [1, N], P[i] does not equal i.Examples: Input: P = [1, 4, 3, 5, 2] Output: 2 Explanation: Here P = [1, 4, 3, 5, 2] at index 1, 2, 3, 4, 5. As we can see, P[1] = 1 and P[3] = 3. Hence, we need
7 min read
Permutation transformation: Minimum operations to achieve permutation
Given an array arr[] of length n, the task is to find the minimum number of operations required to make a permutation of integers 1 to n where you are allowed to select any element arr[i] and replace it with arr[i] % x (x is any positive integer). If it is not possible to make a permutation return -1. Examples: Input: n = 5, arr[] = {2, 3, 4, 4, 5}
8 min read
Count of factors of combination of N and K (nCk)
Given integers N and K, the task is to find the number of factors of NCK. Since the answer can be very large return the count of factors modulo 998244353. Example: Input: N = 5, K = 2Output: 4Explanation: 5C2 = 10 which have {1, 2, 5, 10} as its divisors. So answer would be 4. Input: N = 10, K = 3Output: 16 Approach: The problem can be solved based
11 min read
Largest number upto T formed by combination of As and Bs
Given numbers T, A, and B, the task is to find the greatest number less than equal to T formed by the sum of any combination of A and B (A and B can be used any number of times) along with one special operation that is at any instance sum can be halved (integer division by 2) by its current value at most one time. Examples: Input: T = 8, A = 5, B =
10 min read
Count number of strings (made of R, G and B) using given combination
We need to make a string of size n. Each character of the string is either ‘R’, ‘B’ or ‘G’. In the final string there needs to be at least r number of ‘R’, at least b number of ‘B’ and at least g number of ‘G’ (such that r + g + b <= n). We need to find number of such strings possible. Examples: Input : n = 4, r = 1, b = 1, g = 1. Output: 36 No.
7 min read
Sum of products of all combination taken (1 to n) at a time
Given N, we have to find the sum of products of all combinations taken 1 to N at a time. In simple words, we have to find the sum of products of all combinations taken 1 at a time, then 2 at a time, then 3 at a time till N at a time. If you think closely about the problem, a large value of N could result in producing many combinations. Examples: In
15+ min read
Maximum sum combination from two arrays
Given two arrays arr1[] and arr2[] each of size N. The task is to choose some elements from both arrays such that no two elements have the same index and no two consecutive numbers can be selected from a single array. Find the maximum sum possible of the above-chosen numbers. Examples: Input : arr1[] = {9, 3, 5, 7, 3}, arr2[] = {5, 8, 1, 4, 5} Outp
10 min read
Maximum sum combination from the given array
Given an array arr[] of N integers and three integers X, Y and Z. The task is to find the maximum value of (arr[i] * X) + (arr[j] * Y) + (arr[k] * Z) where 0 ? i ? j ? k ? N - 1. Examples: Input: arr[] = {1, 5, -3, 4, -2}, X = 2, Y = 1, Z = -1 Output: 18 (2 * 5) + (1 * 5) + (-1 * -3) = 18 is the maximum possible sum. Input: arr[] = {2, 4, -9, -64,
12 min read
Find the rank of a given combination from an Array of String
Given an array of string and a string K, the task is to find the rank of the given string if we generate all the combinations of the given array of strings. Examples: Input: string = ['ab', 'pq', 'nm'], K = 'pqnm'Output: 7Explanation: All combination generated are :-'' -------------------> rank 1'ab' -----------------> rank 2'pq' ------------
9 min read
Shortest possible combination of two strings
Compute the shortest string for a combination of two given strings such that the new string consist of both the strings as its subsequences.Examples: Input : a = "pear" b = "peach" Output : pearch pearch is the shorted string such that both pear and peach are its subsequences. Input : a = "geek" b = "code" Output : gecodek We have discussed a solut
15+ min read