The probability of getting the first head on the \( k \)-th toss is given by:
\[ P(\text{first head on toss } k) = (1-p)^{k-1} \cdot p \]
This is because the first \( k-1 \) tosses must be tails (probability \( 1-p \)) and the \( k \)-th toss must be heads (probability \( p \)).
Step 2: We are asked to find the probability that the number of tosses required is even. The event that the number of tosses required is even corresponds to the sum of probabilities for \( k = 2, 4, 6, \ldots \), i.e., the tosses are even.
Step 3: The total probability of getting the first head on an even toss is:
\[ P(\text{even toss}) = (1-p)p + (1-p)^3p + (1-p)^5p + \cdots \]
This is an infinite series where the first term is \( (1-p)p \), and the common ratio between successive terms is \( (1-p)^2 \).
Step 4: The sum of this infinite geometric series is given by:
\[ P(\text{even toss}) = \frac{(1-p)p}{1 - (1-p)^2} \]
Simplifying the denominator:
\[ 1 - (1-p)^2 = 1 - \left(1 - 2p + p^2\right) = 2p - p^2 \]
Thus, the probability of an even toss is:
\[ P(\text{even toss}) = \frac{(1-p)p}{2p - p^2} \]
Step 5: We are told that \( P(\text{even toss}) = \frac{2}{5} \). Therefore, we set the above expression equal to \( \frac{2}{5} \):
\[ \frac{(1-p)p}{2p - p^2} = \frac{2}{5} \]
Step 6: Cross-multiply and simplify:
\[ 5(1-p)p = 2(2p - p^2) \] \[ 5p - 5p^2 = 4p - 2p^2 \] \[ 5p - 4p = 5p^2 - 2p^2 \] \[ p = 3p^2 \] \[ 3p^2 - p = 0 \] \[ p(3p-1) = 0 \]
Step 7: Solving for \( p \), we get \( p = 0 \) or \( p = \frac{1}{3} \). Since \( p = 0 \) is not a valid probability, we conclude that:
\[ p = \frac{1}{3} \]