Begin with representing the number of red marbles with a variable and the number of purple marbles with a variable. To make it easy, r can equal the number of red marbles while p can equal the number of purple marbles.
Next, use the information given to define the variables. We know that the number of purple marbles (p) is 9 less than 2 times the number of red marbles (r). This can be written in mathematic notation as:
p = 2r-9
We also know that the bag of purple and red marbles equals 36, so the other expression would be:
p+r = 36
We want to know how many purple marbles there are, so we should make sure the equations are in terms of purple marbles or p. To do this, subtract p from each side of the second equation defined above. Then, the new equation would look like:
p+r-p = 36-p
The +p and the -p on the left side cancel out, leaving you with:
r = 36-p
Next, we would take this information and plug it into the very first equation defined above. You would replace the r in the first equation with (36-p) so it would turn into:
p = 2r-9
p = 2(36-p)-9
Now we distribute the 2 outside of the parentheses inside of the parentheses. 2 multiplied by 36 gives you 72 and 2 multiplied by -p would give you -2p. The expression is now:
p = 72-2p-9
Combine like terms. This would be 72 and -9 which would give you 63. Now the equation is:
p = 63-2p
Now we need to combine the p's together. To do this, add 2p to both sides, leaving you with
p+2p = 63-2p+2p
3p = 63
Now, to get p alone, we divide each side by 3.
3p/3 = 63/3
p = 21
We solved for p which is the number of purple marbles. So, there are 21 purple marbles in the bag. If you would need to find the number of red marbles, you could just subtract 36 by 21.
Hope this helps!