In this problem, we analyze the system from the frame of reference of the accelerating cube $S$. Since the cube is accelerating to the right with $a = \frac{g}{2}$, any object inside or on the cube experiences a pseudo-force in the opposite direction (to the left) equal to its mass times the acceleration of the frame.
First, let's consider block $P$ which is on the frictionless top surface. Because $P$ is stationary relative to the cube, the forces acting on it horizontally must balance. The forces are the tension $T$ in the thread pulling it to the right and the pseudo-force $m_P a$ acting to the left. Thus:
$$T = m_P \times a = 2 \times \frac{g}{2} = g$$
So, the tension in the thread is equal to the magnitude of gravity $g$.
Next, let's analyze block $Q$, which is against the side wall. In the frame of the cube, the forces acting on $Q$ are:
1. Weight $m_Q g$ acting downwards: $1.5g$.
2. Tension $T$ acting upwards: $g$ (as calculated above).
3. Normal force $N$ from the wall: Since the pseudo-force $m_Q a$ pushes it against the wall to the left, the normal force $N$ acts to the right and is equal to $m_Q a = 1.5 \times \frac{g}{2} = 0.75g$.
4. Friction force $f$ acting vertically.
Since $Q$ is stationary relative to the cube, the net vertical force must be zero. The downward weight $1.5g$ is greater than the upward tension $g$, so static friction $f$ must act upwards to maintain equilibrium:
$$T + f = m_Q g$$
$$g + f = 1.5g \Rightarrow f = 0.5g$$
For the block to remain stationary, this required friction $f$ must be less than or equal to the maximum possible static friction $f_{max} = \mu N$:
$$f \leq \mu N$$
$$0.5g \leq \mu(0.75g)$$
$$\mu \geq \frac{0.5}{0.75} = \frac{2}{3} \approx 0.67$$
The value of $\mu$ required for the blocks to remain stationary is $0.67$.