Step 1: Review of Mean and Variance Formulas
For a binomial distribution with parameters \( n \) and \( p \), the mean and variance are expressed as:
\[
\mu = np, \quad \sigma^2 = np(1 - p)
\]
Step 2: Formulating the Equations
We are provided with the following equations:
\[
np = 18, \quad np(1 - p) = 12
\]
By dividing the second equation by the first:
\[
(1 - p) = \frac{12}{18} = \frac{2}{3}
\]
which simplifies to:
\[
p = \frac{1}{3}
\]
Step 3: Solving for \( n \)
Substitute \( p = \frac{1}{3} \) into the first equation:
\[
n \times \frac{1}{3} = 18
\]
Solving for \( n \):
\[
n = 18 \times 3 = 54
\]