risk free hedge

In the derivatives reading 64 (problem 4), I understand how to calculate the risk-free hedge. However, how do you know whether to long or short the call options in period 1 and period 2? Thank you.

I don’t see the problem but if you are long the stock (likely as most questions seem to do this) you are short the call option. Short the stock…long the options.

long stock - short call option long stock - long put option short stock - long call option short stock - short put option