There are 352 marbles in the bag.
First, let's define some variables. The number of red marbles can be defined by the variable r, the number of blue marbles can be defined by the variable b, and the total number of marbles in the bag can be defined by the variable T. Next, we can translate the word problem into a system of equations. If 5/8 of the marbles are red, then we can say that (5/8)T = r. Since the difference between the number of red marbles and blue marbles is 88, we can say either r - 88 = b or b - 88 = r. However, since r = (5/8)T, and 5/8 is larger than 1/2, we can say that r > b, so r - 88 = b is the only valid equation. Finally, since there are only red and blue marbles in the bag, we can say that r + b = T.
In order to reduce the number of variables to two and limit the number of equations in the system to two, we can subsitute b = r - 88 into r + b = T, so that it becomes r + (r - 88) = T, and then becomes 2r - 88 = T. Since we are solving for T, we want to subsitute r in the previous equation and solve the equation for T:
2((5/8)T) - 88 = T
(5/4)T - 88 = T
(1/4)T = 88
T = 352
Therefore, there are a total of 352 marbles in the bag.