To solve for side \( a \) given that \( a = \frac{1}{2}b \), we start with the information provided:
- \( b = 12 \) meters.
Now, substituting into the equation:
\[ a = \frac{1}{2} \times 12 \text{ meters} = 6 \text{ meters} \]
So the length of side \( a \) is 6 meters.
Next, we need to calculate the perimeter of the donkey's pen, which is a rectangle, so the formula for the perimeter \( P \) is:
\[ P = 2(a + b) \]
Substituting the values of \( a \) and \( b \):
\[ P = 2(6 \text{ meters} + 12 \text{ meters}) = 2(18 \text{ meters}) = 36 \text{ meters} \]
Thus, the perimeter of the donkey's pen is 36 meters.
Final Answers:
- Side \( a \): 6 meters
- Perimeter: 36 meters