# When to use brackets in symbolic logic?

I'm a little confused on when to use brackets in symbolic logic. My initial knowledge was that it was to reduce ambiguity.

I've seen that p ^ (q v r) does not equal (p ^ q) v r via truth table induction.

But I've also proved myself that p ^ q ^ r is logically equivalent to p ^ (q ^ r) via the same logic.

In the textbook I am using the answer for p, q, and r written in English is p ^ q ^ r, but the answer for neither p nor q, but r is (~p ^ ~q) ^ r.

I'm just not quite making the connection on when to use the brackets, and when not too except for some vague patterns that I have noticed.

I assume this is in the context of a class: you should not be marked down for writing $p \land (q \land r)$ as opposed to $p \land q \land r$, as the expressions are equivalent. However, try not to go overboard a la $(((p)) \land ((q) \lor r))$. As a general rule of thumb in your notation: strive to be as clear as possible, and avoid making a mess.