So we know that 8 girls brought lunchboxes. And 4 didn't. And we also know that 2 boys brought a lunchbox, but 6 didn't.
This means that there are 10 kids in total who brought a lunchbox. 10/20 = 1/2. So if you choose a random child from the class, you have a 1/2 chance of getting a kid that has a lunchbox.
Please reply if I'm wrong.