You can remember the two relationships:
\[ n = \frac{e}{1+e} \quad \text{and} \quad e = \frac{n}{1-n} \]
A good way to check your answer is to remember that porosity (\(n\)) must always be less than 1, while void ratio (\(e\)) can be greater than 1.
If \(n=0.5\), then \(e = 0.5/(1-0.5) = 1\), which makes sense.