Given a set containing N elements. If two subset X and Y picked then find the probability that both of them contains the same number of elements.
Let’s choose a subset X that has r number of elements then Y must contain r number of elements. A subset can have minimum 0 elements and maximum N elements.
Total number of subset of a set contains N number of elements is , Total possible way to choose X and Y simultaneously will be = = .
Let, P = Total possible way to choose X and Y such that both has same number of elements.
Then P = = =
So the required probability will be .
Below is the implementation of the above Approach:
- Maximum sum subset having equal number of positive and negative elements
- Fibonacci sum of a subset with all elements <= k
- Maximum subset sum such that no two elements in set have same digit in them
- Largest subset whose all elements are Fibonacci numbers
- Find the length of the Largest subset such that all elements are Pairwise Coprime
- Find maximum subset sum formed by partitioning any subset of array into 2 partitions with equal sum
- Probability that a N digit number is palindrome
- Random number generator in arbitrary probability distribution fashion
- Probability of getting a perfect square when a random number is chosen in a given range
- Check whether bitwise AND of a number with any subset of an array is zero or not
- Count number of subsets whose median is also present in the same subset
- Python | Number of elements to be removed such that product of adjacent elements is always even
- Smallest number dividing minimum number of elements in the array | Set 2
- Smallest number dividing minimum number of elements in the Array
- Number of possible permutations when absolute difference between number of elements to the right and left are given
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.