Since an equal number of pieces of candy were given to children on Halloween, and obviously, a different amount of boys and girls were present on Halloween. Since 30 pieces of candy were given out to boys and 48 were given out to girls, a certain amount of candy was given to some amount of boys to equal 30, and that same amount of candy was given to another amount of girls to equal 48. Since we are looking for the greatest number of pieces given to each child, we are looking for the greatest common divisor of 30 and 48, which is 6.