# Wild About Math!Making Math fun and accessible

17Jan/091

## MMM #23: Winner!

Kevin Wang is the winner of MMM #23. Congratulations, Kevin!

Here is Kevin's solution:

Each run of heads must be bordered by two tails or a tail and an end. Also, we know that there are only 11 possible positions for the first coin. Thus, we can just list all of the possibilities, number them for reference later, and allow for wildcard places as such:

H H H H H H H H H H T X X X X X X X X X (1)
T H H H H H H H H H H T X X X X X X X X (2)
X T H H H H H H H H H H T X X X X X X X (3)
X X T H H H H H H H H H H T X X X X X X (4)
X X X T H H H H H H H H H H T X X X X X (5)
X X X X T H H H H H H H H H H T X X X X (6)
X X X X X T H H H H H H H H H H T X X X (7)
X X X X X X T H H H H H H H H H H T X X (8)
X X X X X X X T H H H H H H H H H H T X (9)
X X X X X X X X T H H H H H H H H H H T (10)
X X X X X X X X X T H H H H H H H H H H (11)

In each scenario, the amount of cases is equal to two to the power of the number of X's, so we can elaborate by case.

Case 1: 2^9 = 512
Case 2: 2^8 = 256
Case 3: 2^8 = 256
Case 4: 2^8 = 256
Case 5: 2^8 = 256
Case 6: 2^8 = 256
Case 7: 2^8 = 256
Case 8: 2^8 = 256
Case 9: 2^8 = 256
Case 10: 2^8 = 256
Case 11: 2^9 = 512

Add these all up, and you get 9*(2^8)+2*(2^9), 2304+1024, 3328 total combinations.

Zach Feinstein contributed a Matlab verification of his solution:

function sum = mmm23()
sum = 0;
for setup = 0:2^20-1
set = dec2bin(setup,20);
sum = sum + check(set);
end
end

function result = check(set)
consecutive = 0;
result = 0;
for ii = 1:length(set)
if set(ii) == '1'
consecutive = consecutive + 1;
elseif consecutive == 10
result = 1;
return;
else
consecutive = 0;
result = 0;
end

end
if consecutive == 10
result = 1;
end
end

Stay tuned for another Monday Math Madness contest, at BlinkDagger, on Monday.