There are 4 people with hats sitting in a row. They are all facing the left. In order from left to right, their names are Jessica, Chelsea, Andrew, and Jack. They are all wearing a hat that is either red or blue.
Jessica is wearing a red hat,
Chelsea is wearing a blue hat,
Andrew is wearing a red hat,
And Jack is wearing a blue hat.
There are 2 red hats and 2 blue hats, but none of them know what color hat they are wearing. When one of them knows what color hat they have on, they yell out the color. There is a wall between Jessica and Chelsea, so neither Jessica nor Chelsea can see any hats in front of them. Jack can see Andrew and Chelsea’s hat color, and Andrew can only see Chelsea’s hat color. Only one of them knows what color hat they have. Who is it? And why?