(3) If a number $x$ is randomly chosen from the interval $[-1,1]$, the probability that $\cos \frac{\pi x}{2}$ lies between 0 and $\frac{1}{2}$ is ( ).
(A) $\frac{2}{3}$
(B) $\frac{2}{\pi}$
(C) $\frac{1}{2}$
(D) $\frac{1}{3}$
(3) D Hint: From $\cos \frac{\pi x}{2}=\frac{1}{2}$, we get $x= \pm \frac{2}{3}$. Since the period of the function $y=\cos \frac{\pi x}{2}$ is 4, from the graph of the function $y=\cos \frac{\pi x}{2}$, we can see that the points where $\cos \frac{\pi x}{2}$ has values between 0 and $\frac{1}{2}$ fall within $\left[-1,-\frac{2}{3}\right]$ and $\left[\frac{2}{3}, 1\right]$. Therefore, the required probability $P=$ $\frac{2 \times \frac{1}{3}}{2}=\frac{1}{3}$. Hence, the answer is D.