You can get the answer by using algebra or by guessing the number of black and seeing what works.
Perhaps you are not learning algebra yet.
If I guess there are 5 black hats, then there are 8 red ones and 1 purple one. The sum is 14. So that's the answer.
A magician has 3 more red hats than black hats and 4 fewer purple hats than black hats and has 14 hatsin all. How many hats of each color does he have. Show how you got the answer.
2 answers
B+3=R
B-4=P
B+P+R=14
substitute for P and R
(B)+(B-4)+(B+3)=14
3B-1=14
solve from here
B-4=P
B+P+R=14
substitute for P and R
(B)+(B-4)+(B+3)=14
3B-1=14
solve from here