Mathematics (JEE)Very hardCodeforces Div2 C
How many nonempty subsets of {1, 2, ..., 10} have an element sum that is divisible by 5?
- A. 208
- B. 204
- C. 207
- D. 205
Correct answer: C. 207
A roots-of-unity filter over residues mod 5 counts (2^10 + 4 * 4)/5 = 208 subsets including the empty set, since the product over 1..10 of (1 + w^k) equals 4 for each primitive 5th root w; removing the empty set gives 207.
Practise more Permutations, Combinations and Probability questionsPermutations, Combinations and Probability: notes and key points
More Permutations, Combinations and Probability questions
- How many 4-element subsets of {1, 2, ..., 12} have an element sum divisible by 3?
- How many binary strings of length 10 contain neither the substring 11 nor the substring 000?
- How many words of length 6 over the alphabet {a, b, c} contain neither the substring aa nor the substring bb?
- How many partial orders (reflexive, antisymmetric and transitive relations) are there on the labelled set {1, 2, 3, 4}?
- How many relations R on the set {1, 2, 3} are transitive, meaning that whenever (a,b) and (b,c) are in R, then (a,c) is also in R?…
- How many functions f from {1, 2, 3, 4, 5} to itself satisfy f(f(x)) = f(x) for every x?