Algebra word problem (Red and Yellow Jelly Beans)

A jar contains some red and some yellow jelly beans. If a child ate 1 red jelly bean, 1/7 of the remaining candies would be red. If instead the child ate 5 yellow jelly beans, 1/6 of the remaining candies would be red. How do I found out the number of jelly beans that are in the jar?

-
What have you tried so far? –  Oscar Cunningham Jan 18 '11 at 0:14
This has nothing to do with probability. –  Aryabhata Jan 18 '11 at 0:15
@user5962: How is this a probability question? –  user17762 Jan 18 '11 at 0:17
It is not "linear algebra" either. –  Andres Caicedo Jan 18 '11 at 0:21
@Andres: Well, 2 linear equations, 2 variables :-) –  Aryabhata Jan 18 '11 at 0:25

HINT $\$ Put $\rm R =$ #red beans. Then the total #beans $\rm\: =\ 7\ (R-1) + 1\ =\ 6\ R + 5\:.$

-
thank you very much –  user5962 Jan 18 '11 at 1:36

Use algebra.

Let R be the number of red beans, and Y be the number of yellow beans. Then the second and third sentences can be expressed as equations in R and Y. Solve this pair of equations, and you've got it.

For instance, the second sentence tells us that $\frac{R-1}{R+Y-1}=\frac{1}{7}$.

-
thank you very much! –  user5962 Jan 18 '11 at 0:20