At a school camp, 30% of the students were boys. When 87 students left the camp after the second day, half the original number of boys were left behind and the number of girls decreased by 20%. How many girls were at the camp in the beginning.

number of boys --- 3x

number of girls ---- 7x

total campers = 10x

after leaving:
total campers = 10x-87
number of boys = 3x/2
number of girls = (8/10)(7x) = 28x/5

3x/2 + 28x/5 = 10x - 87
times 10
15x + 56x = 100x - 870
-29x = -870
x = 30

number of girls at start = 7x = 210

check:
at start:

boys -- 90
girls -- 210
total -- 300

after the wimps left:
boys = 45
girls = .8(210) = 168
total = 45+168 = 213
which is the same as 300-87 = 213

all looks good

To solve this problem, we need to break it down into steps.

Step 1: Find the number of boys in the beginning
Given that 30% of the students were boys, we can calculate the total number of students in the beginning. Let's call this value 'x'.

So, 30% of 'x' is the number of boys. This can be written as (30/100) * x. Simplifying this expression gives us 0.3x.

Step 2: Calculate the number of boys left after 87 students left
According to the problem, after 87 students left, half the original number of boys were left behind. This means that the number of boys left is 0.5 * 0.3x, which simplifies to 0.15x.

Step 3: Calculate the number of girls in the beginning
To find the number of girls in the beginning, we need to subtract the number of boys from the total number of students. Since the number of boys is 0.15x, the number of girls is x - 0.15x.

Step 4: Calculate the number of girls after a 20% decrease
According to the problem, the number of girls decreased by 20% after 87 students left the camp. This means that the number of girls left is 0.8 times the original number. So, 0.8 * (x - 0.15x) is the number of girls remaining.

Step 5: Formulate the equation
We can now formulate the equation based on the given information. The number of girls remaining after the decrease is 0.8 * (x - 0.15x), which equals x - 0.15x - 87.

Step 6: Solve the equation
Now we can solve the equation to find the value of 'x'. By simplifying the equation, we get 0.85x - 87 = x - 0.15x. Combining like terms gives us 0.7x - 87 = 0.85x. Rearranging the equation, we have 0.85x - 0.7x = 87, which simplifies to 0.15x = 87. Solving for 'x', we get x = 87 / 0.15.

Step 7: Calculate the value of 'x'
Using a calculator, we can find that x is approximately equal to 580.

Therefore, there were 580 girls at the camp in the beginning.