# Flip a coin

In the study of probability, flipping a coin is a commonly used example of a simple experiment. When a fair, two-sided coin is flipped, the two possible outcomes are heads (left) or tails (right), as shown in the figure below.

The sample space of an experiment is the set of all possible outcomes of an experiment. The sample space for flipping a coin can be denoted as

{H, T}

where H is heads and T is tails.

Each of the two possible outcomes has an equal likelihood of occurring, assuming that the coin is fair. Given that A represents the event that heads occurs, and B represents the event where tails occurs, the probability, P, of heads occurring can be denoted as P(A) = 1/2. Similarly, the probability of tails occurring can be denoted as P(B) = 1/2.

For any flip of a fair, two-sided coin, only heads or tails can occur. Thus, the outcomes of the flip of a coin are said to be mutually exclusive events since both events cannot occur at the same time. Also, because any one flip of the coin has no bearing on the outcome of another flip, each flip of a coin is an independent-event.

## Sample space when more than one coin is flipped

When two or more coins are flipped the sample space can be denoted as:

{HH, HT, TH, TT}

Note that although the outcomes TH and HT both have one heads and one tails, they are considered different outcomes. The probability that any one of these events occurs is 1/4.

Similarly, the sample space for flipping three coins can be denoted as:

{HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}

The probability that any one of these events occurs is 1/8.

Notice that when one coin is flipped, the sample space contains 2 possible outcomes; when two coins are flipped, the sample space contains 4, or 22 outcomes; when three coins are flipped, the sample space contains 8, or 23 outcomes, and so on. The number of outcomes is therefore a function of the number of coins flipped, and is equal to 2n. Knowing the sample space allows us to compute various probabilities.

## Probabilities with two or more coin flips

Given the sample space of an experiment, the probability of any event occurring can be calculated by dividing the number of outcomes that fulfill the desired criteria by the total number of possible outcomes. For example, the sample space for flipping two fair two-sided coins is:

{HH, HT, TH, TT}

If we wanted to determine the probability that a coin that is flipped twice first lands on heads, and then lands on tails, there is only one way that this outcome can occur, since order matters. Thus, out of 4 possible outcomes, only 1 yields the desired result, and the probability of this outcome (A) is:

P(A) = 1/4

If we instead wanted to determine the probability that, of the two flips, only one results in a coin landing on heads, there are two possible ways that this can occur: HT or TH. Thus, the probability of this outcome (A) is:

P(A) = 2/4 = 1/2

Similarly, if a coin were flipped three times, the sample space is:

{HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}

If the desired outcome (A) is at least two heads occurring, there are three possible ways that this can occur: HHT, HTH, THH. The probability of this outcome is therefore:

P(A) = 3/8

These probabilities are relatively simple to calculate, since the sample space does not contain many possible outcomes, and the experiment is simple. However, the concept can be extended to more complicated examples, and formulas exist for computing these types of probabilities. For example, the probability of two or more independent events occurring is the product of their probabilities. In the case of flipping a coin, the probability of heads or tails occurring is always 1/2, so for an experiment in which a coin is flipped n times, the probability of observing any one of the possible outcomes (A) in the sample space can be computed as:

P(A) = (1/2)n

where n is the number of times a fair, two-sided coin is flipped.

When a coin is flipped twice,

P(A) = (1/2)2 = 1/4

Similarly, when a coin is flipped three times:

P(A) = (1/2)3 = 1/8
{"ft_lang_label":"__label__en","ft_lang_prob":0.9458309,"math_prob":0.9935575,"size":4035,"snap":"2022-27-2022-33","text_gpt3_token_len":970,"char_repetition_ratio":0.18035227,"word_repetition_ratio":0.07044199,"special_character_ratio":0.23568773,"punctuation_ratio":0.12835473,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99987555,"pos_list":[0,1,2],"im_url_duplicate_count":[null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-06-27T21:58:20Z\",\"WARC-Record-ID\":\"<urn:uuid:b898a677-0b3d-48b1-8b75-4bd4a74a6b8c>\",\"Content-Length\":\"9635\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:292c18e1-c3f2-4808-ae6c-f7064f3db677>\",\"WARC-Concurrent-To\":\"<urn:uuid:6ece6528-6aa2-4dd1-8a44-d9b27cce2de5>\",\"WARC-IP-Address\":\"69.10.42.198\",\"WARC-Target-URI\":\"https://www.math.net/flip-a-coin\",\"WARC-Payload-Digest\":\"sha1:Y7DSXCTCPLCUMV34GIIDLSRZPRGGZCRR\",\"WARC-Block-Digest\":\"sha1:W3HNKLWAOJBDUN4DTY7C43FBAM3Q23RB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656103341778.23_warc_CC-MAIN-20220627195131-20220627225131-00748.warc.gz\"}"}