Answer
The boy can walk to the point that is 1.0 meter from the end of the beam without the beam tipping.
Work Step by Step
Let $m_b$ be the mass of the beam and let $m_y$ be the mass of the boy.
When the boy reaches the limit just before the beam starts to tip, the upward force exerted by the left post will be zero. We can consider the net torque about an axis of rotation located at the position of the right post. We can find $r_y$, the boy's distance from the right post. Note that the beam's center of mass is 0.5 meters from the right post.
$\sum \tau = 0$
$r_b~m_b~g - r_y~m_y~g = 0$
$r_b~m_b~g = r_y~m_y~g$
$r_y = \frac{r_b~m_b}{m_y}$
$r_y = \frac{(0.5~m)(40~kg)}{20~kg}$
$r_y = 1.0~m$
The boy can go up to 1.0 meter past the right post. The boy can walk to the point that is 1.0 meter from the end of the beam without the beam tipping.