How many 3-element subset from a set A = { 1 , 2 , 3 , . . . , 2 5 } such that the subset does not have two consecutive number. For any subset { a 1 , a 2 , a 3 } ; ∣ a i − a j ∣ = 1
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We look at the problem as a biner with the length of 2 5 . a 1 a 2 a 3 ⋯ a 2 5 With a i is either 1 or 0 and we denote ( 1 = a i choosen) or ( 0 = a i not choosen) So We will put these 2 2 number 0 first, then we will choose the position of number 1 between these 0 so that there’s no two consecutive number will be selected. + 0 + 0 + 0 + ⋯ + 0 + 0 + 0 + The answer is C 3 2 3 = 1 7 7 1
Slight problem - C 3 2 2 = 1 5 4 0 .
Ya it should be 23C3
My mistake, Thank you
Problem Loading...
Note Loading...
Set Loading...
<?php
$t=0;
for($a=1;$a<=21;$a++){
for($b=$a+2;$b<=23;$b++){
for($c=$b+2;$c<=25;$c++){
$t++;
}
}
}
echo $t;
?>
Some quick and dirty loops gave me the correct answer, basically my theory was $a will always be the lowest number, $b will be the middle number and must be at least 2 greater than $a, and $c will be the highest number and must be 2 greater than $b.
$t just acts as a total and when we print it at the end it gives us our answer 1771