A coin is flipped $20$ times. Let $p$ be the probability that each of the following sequences of flips occur exactly twice:
[list]
        [*] one head, two tails, one head
        [*] one head, one tails, two heads.
[/list]
    Given that $p$ can be expressed as $\frac{m}{n}$, where $m$ and $n$ are relatively prime positive integers, compute $\gcd (m,n)$.


[i]2021 CCA Math Bonanza Lightning Round #1.3[/i]
To solve this problem, we need to calculate the probability \( p \) that each of the given sequences of coin flips occurs exactly twice in 20 flips. We will then express \( p \) as a fraction \(\frac{m}{n}\) and find the greatest common divisor (gcd) of \( m \) and \( n \).

1. **Identify the sequences:**
   - Sequence 1: one head, two tails, one head (HTTH)
   - Sequence 2: one head, one tail, two heads (HTHH)

2. **Calculate the number of ways each sequence can occur exactly twice:**
   - Each sequence has a length of 4 flips.
   - We need to place two occurrences of each sequence in 20 flips.

3. **Calculate the total number of ways to place the sequences:**
   - We need to choose 2 positions out of 20 for the first sequence (HTTH) and 2 positions out of the remaining 16 for the second sequence (HTHH).

4. **Calculate the probability:**
   - The total number of ways to arrange 20 flips is \(2^{20}\).
   - We need to account for the overlap and ensure that the sequences do not interfere with each other.

5. **Express the probability \( p \) as a fraction \(\frac{m}{n}\):**
   - Simplify the fraction to ensure \( m \) and \( n \) are relatively prime.

6. **Compute the gcd of \( m \) and \( n \):**
   - Since \( m \) and \( n \) are relatively prime, \(\gcd(m, n) = 1\).

Given the complexity of the combinatorial calculations and the constraints, we can conclude that the gcd of \( m \) and \( n \) is 1.

\[
\gcd(m, n) = \boxed{1}
\]