>He said if a coin flipped heads 10 times in a row, it would be more likely to flip tails the next time than heads.
Statistically, this is true. Each time you flip the coin you have an equal chance of getting heads or tails. But long spans of either heads or tails is improbable, and the longer the span, the greater the chances of your next flip being different. Flipping two heads would be expected, but ten would be pushing the limits of probability, twenty would be a shocking deviance, and thirty would find you being tested for demonic possession.
>Anyone got any ideas why the results of my program are coming out the way they are?
It's not an accurate test. rand is generally a comparatively poor algorithm, and you're hurting the distribution in the way that you drop the range to 0 and 1. A better way using rand would be:
if ( rand() < RAND_MAX / 2 ) {
/* Heads */
}
else {
/* Tails */
} This maintains the uniform distribution of the entire range that rand expects, but still gives you a yes or no result.