Given 2n girls and randomly divided into two subgroups each containing n girls. The task is to count the number of ways in which groups can be formed such that two beautiful girls are into different groups.
Let group be r1, r2, b1, b2 where b1 and b2 are beautiful girls
Groups are: ((r1, b1) (r2, b2)), ((r1, b2) (r2, b1)), ((r2, b2) (r1, b1)), ((r2, b1) (r1, b2))
Approach: There are two ways in which the two beautiful girls lie in different groups and corresponding to each way the remaining (2n – 2) girls can be divided into two groups is
Hence total number of ways are 2 *
Implementation Code :
- Dividing an array into two halves of same sum
- Ways of selecting men and women from a group to make a team
- Ways to multiply n elements with an associative operation
- Ways to sum to N using array elements with repetition allowed
- Number of ways to form an array with distinct adjacent elements
- Maximum value with the choice of either dividing or considering as it is
- Count of divisors having more set bits than quotient on dividing N
- Split N^2 numbers into N groups of equal sum
- Number of Groups of Sizes Two Or Three Divisible By 3
- Divide 1 to n into two groups with minimum sum difference
- Find sum of N-th group of Natural Numbers
- Nicomachus’s Theorem (Sum of k-th group of odd positive numbers)
- number-theoryGenerators of finite cyclic group under addition
- Count number of digits after decimal on dividing a number
- Minimum sum of the elements of an array after subtracting smaller elements from larger
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.