Red and white beads problem