# A fair coin is tossed until a head appears

A fair coin is tossed until a head (H) appears, but at most 3 times. X: "number of tosses".
I have to find a sample space, a definition for X and a probability function.
My ideas:
$\Omega=\{H, TH, TTH\}$ (T: Tails)

$X: \Omega ---> X(\Omega)=\{1,2,3\}$; $X(\omega)=\begin{cases} 1, & \text{if$\omega=H$} \\ 2, & \text{if$\omega=TH$} \\ 3, & \text{if$\omega=TTH$} \\ \end{cases}$

$P(X=k)=\begin{cases} 1/2, & \text{if$k=1$} \\ 1/4, & \text{if$k=2$} \\ 1/8, & \text{if$k=3$} \\ \end{cases}$

Question: Is the case "TTT" also an element of $\Omega$ and if yes, how do I put it into the definition of X ("TTT" are also obtained after 3 tosses)

-

Yes, you need TTT as an outcome. We have $X=3$ if TTH or TTT, and $\Pr(X=3)=\frac{1}{4}$.
Remark: The sample space $\{\text{H, TH, TTH, TTT}\}$ is almost certainly what you are expected to use. However, the space is by no means uniquely defined. Another essentially equivalent sample space would be $\{1,2,3,\text{F}\}$ (F for failed).