Pattern matching question

I’ve only started using pattern matching recently and usually get it to work properly.

My question concerns part a) in the included screen. I’ve managed to exclude most forms that are supposed to be incorrect. However, the CL marks an answer in the form (B+C)A as correct while I want it only to mark the form A(B+C) as correct. What needs to be changed? Thank you so much for all your help.

Adding .strictOrder to the end of the product pattern forces the terms to only be accepted in the order you have stated.

Match=p.product(p.number,p.sum(p.number,p.number)).strictOrder
3 Likes

Perfect! Thank you so much!