There are N boys which are to be seated around a round table. The task is to find the number of ways in which N boys can sit around a round table such that two particular boys sit together.
Input: N = 5
2 boy can be arranged in 2! ways and other boys
can be arranged in (5 – 1)! (1 is subtracted because the
previously selected two boys will be considered as a single boy now)
So, total ways are 2! * 4! = 48.
Input: N = 9
- First, 2 boys can be arranged in 2! ways.
- No. of ways to arrange remaining boys and the previous two boy pair is (n – 1)!.
- So, Total ways = 2! * (n – 1)!.
Below is the implementation of the above approach:
- Seating arrangement of n boys and girls alternatively around a round table
- Puzzle | Neighbors in a round table
- Arrangement of the characters of a word such that all vowels are at odd places
- Maximum height of triangular arrangement of array values
- Arrangement of words without changing the relative position of vowel and consonants
- Round the given number to nearest multiple of 10
- Round the given number to nearest multiple of 10 | Set-2
- Program for Binomial Coefficients table
- Compute the parity of a number using XOR and table look-up
- Find the number of cells in the table contains X
- Permutations to arrange N persons around a circular table
- Program to print multiplication table of a number
- Round-off a number to a given number of significant digits
- Number of ways to arrange 2*N persons on the two sides of a table with X and Y persons on opposite sides
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.