Finding concentration and moles given final and initial pH
Both the cases are similar, so I'll show you the calculation for the fist case only:

The $[\ce{H+}]$ ion concentration changes from $\pu{10^-2~M}$ to $\pu{10^-11~M}$. Assuming water at $\pu{25^\circ C}$, this implies the change in $[\ce{OH-}]$ ion  concentration from $\pu{10^-12~M}$ to $\pu{10^-3~M}$. Since the volume of the solution is fixed at $\pu{500L}$, the amount of $\ce{OH-}$ ions has changed from $500\times\pu{10^-12 moles}$ to $500\times\pu{10^-3 moles}$. This change is exactly the number of moles of $\ce{NaOH}$ that need to be added to this solution, since $\ce{NaOH}$ is a strong base and dissociates with $100\%$ yield.