(a) Let, at any moment of time, charge on the plates be $\left(q_{0}-q\right)$ then current through the resistor, $i=-\frac{d\left(q_{0}-q\right)}{d t}$, because the capacitor is discharging.
or, $i=\frac{d q}{d t}$
Now, applying loop rule in the circuit, $i R-\frac{q_{0}-q}{C}=0$
or, $\frac{d q}{d t} R=\frac{q_{0}-q}{C}$
or, $\frac{d q}{q_{0}-q}=\frac{1}{R C} d t$
At $t=0, q=0$ and at $t=\tau, q=q$
So,
$$
\ln \frac{q_{0}-q}{q_{0}}=\frac{-\tau}{R C}
$$
Thus
$$
q=q_{0}\left(1-e^{-\tau / R C}\right)=0 \cdot 18 \mathrm{mC}
$$
(b) Amount of heat generated $=$ decrement in capacitance energy
$$
\begin{gathered}
=\frac{1}{2} \frac{q_{0}^{2}}{C}-\frac{1}{2} \frac{\left[q_{0}-q_{0}\left(1-e^{-\tau / R C}\right)\right]^{2}}{C} \\
=\frac{1}{2} \frac{q_{0}^{2}}{C}\left[1-e^{-\frac{2 \tau}{R C}}\right]=82 \mathrm{~mJ}
\end{gathered}
$$