# Probability: Finding The Expectation and Variance of Runs

Last week, I completed a summer course at Stanford: CS109, Probability for Computer Scientists. This 8-week long class was intense and challenging but one of the most rewarding classes I've taken at Stanford so far. A few weeks ago, I had an idea for a homework problem but I couldn't quite figure out how to implement the idea. The problem is the following: Below are two sequences of 300 “coin flips” (H for heads, T for tails). One of these is a true sequence of 300 independent flips of a fair coin. The other was generated by a person typing out H’s and T’s and trying to seem random. Which sequence is the true sequence of coin flips? Make an argument that is justified with probabilities calculated on the sequences. Both sequences have 148 heads, two less than the expected number for a 0.5 probability of heads.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9640195,"math_prob":0.85426676,"size":897,"snap":"2019-35-2019-39","text_gpt3_token_len":194,"char_repetition_ratio":0.12318029,"word_repetition_ratio":0.0,"special_character_ratio":0.22296543,"punctuation_ratio":0.10055866,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9706026,"pos_list":[0,1,2],"im_url_duplicate_count":[null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-08-25T01:40:45Z\",\"WARC-Record-ID\":\"<urn:uuid:bb7e5b56-4c29-4f41-b902-d85052c5e561>\",\"Content-Length\":\"33629\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b2d7f743-b288-4e49-baee-16ba51459d9c>\",\"WARC-Concurrent-To\":\"<urn:uuid:6c7e2ba4-d971-4cc7-8df2-d8eb3cfc0af5>\",\"WARC-IP-Address\":\"52.27.220.164\",\"WARC-Target-URI\":\"http://rozmichelle.com/tag/math/\",\"WARC-Payload-Digest\":\"sha1:A2AZ4WOTLVZP6ONXBHGDHBJYIRXQWZQD\",\"WARC-Block-Digest\":\"sha1:ONUDPVK5324XCS4VIB2HUIK7XCPSBDNZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-35/CC-MAIN-2019-35_segments_1566027322160.92_warc_CC-MAIN-20190825000550-20190825022550-00099.warc.gz\"}"}