First we create a balanced equation
HA <-> H(+) + A(-)
Then, we set up an ICE table
HA <--> H(+) + A(-)
[]i 0.5M 0M 0M
Δ[] -x +x +x
[]f 0.5M-x 0.0001M 0.0001M
From this, we can say that x = 0.0001.
Next, we set up the equation
Ka = [H+][A-]/[HA]
Ka = [0.0001][0.0001]/[0.5-0.0001]
Ka = 2x10^-8