1
$\begingroup$

I have n sets having values less than 100. I need to find how many arrangements could be made if I pick one element from each set such that in the given arrangement there are no duplicates? NOTE: A set can have no duplicate itself( set's property) and it can have maximum 100 elements.

Example: if n = 3 set 1= { 3 4 5 } set 2= { 1 } set 3= { 1 3 5}

Possible arrangements = {3 1 5} {4 1 3} {4 1 5} {5 1 3}

hence my answer is 4.

$\endgroup$
  • 1
    $\begingroup$ Just wanted to clarify something: The sets have a maximum of 100 elements and the elements themselves are integers less than 100? $\endgroup$ – BeaumontTaz Aug 9 '14 at 20:21
  • $\begingroup$ This question has already been asked three times (at least) on this site. Use the inclusion-exclusion principle. Stop. $\endgroup$ – Jack D'Aurizio Aug 9 '14 at 20:33
  • $\begingroup$ @Jack D'Aurizio thanks i will try that . @ BeaumontTaz yes , the elements are themselves less than 100 $\endgroup$ – ratish Aug 9 '14 at 20:38
  • $\begingroup$ can anyone give a solution example ? $\endgroup$ – ratish Aug 10 '14 at 7:13
  • 1
    $\begingroup$ @ratish Yet another variant on the active contest problem codechef.com/AUG14/problems/TSHIRTS . We'll give an example sometime after August 15. Please stop asking contest problems. $\endgroup$ – deinst Aug 10 '14 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.