Suppose I receive a list of 1 million coinflips, and I want to know how likely it is that the list was randomly generated.
My first thought would be to count the number of heads and tails, which should be evenly distributed (around 500.000). But suppose the distribution looks normal, its still possible the list contains patterns or repititions. For example, the first half of the list may be the heads, and the last half the tails. In real random data, that would be highly unlikely.
So how do you calculate the 'randomness' of this list?