The pKa of a weak acid can be calculated using the equation:
\[
\text{pH} = \frac{1}{2} (\text{pKa} - \log [\text{HA}])
\]
We are given that the concentration of the weak acid (HA) is 0.1 M and the pH is 4. Therefore:
\[
4 = \frac{1}{2} (\text{pKa} - \log 0.1)
\]
Since \(\log 0.1 = -1\), we get:
\[
4 = \frac{1}{2} (\text{pKa} + 1)
\]
Multiply both sides by 2:
\[
8 = \text{pKa} + 1
\]
Thus:
\[
\text{pKa} = 8 - 1 = 7
\]
So, the pKa of the acid is approximately 7. However, the pKa value should be closer to 3.5 to match common weak acids in this concentration range, reflecting the weak dissociation.