When switch Q is closed, the current has three pathways to go:
1 – the path which has bulbs X and Y
2 – the second path which has 2 bulbs
3 – the third path with switch Q.
When switch Q is opened, current only has 2 pathways. Therefore, current through bulb X will increase causing it to become brighter.
When switch P is closed, the series circuit becomes a parallel circuit. This causes current to travel through two path ways: the first one through switch P and second though the bulb.
Current received by bulb Y would decrease causing it to go dimmer.