Four intellectuals are lined up so that each intellectual can see the ones in front of him but not the ones behind him. (The back one can see the other three, and the front one can't see anybody.) One hat is placed on the heads of each of the intellectuals. (None of them may see the color of their own hat, but each may see the color of the hats on the intellectuals in front of him.) Each of the four hats are one of three different colors (red, white, and blue), and there is at least one hat of each color (so there's one duplicate). Each of the intellectuals, starting with the back and ending with the front, is asked the color of the hat he is wearing. Each of the intellectuals is able to deduce and give a correct answer out loud, in turn. What arrangement of the hats permits this to be possible without guessing (since the specific colors chosen are arbitrary, just indicate which two intellectuals must be wearing hats of the same color), and how did they do it?

I think the guys in the front have the same color hat

The first and the second one are wearing the same color hat. The intellectual in the very back would be able to see that the first and second intellectuals have the same color hat and would be able to see the third intellectuals hat, so by elimination, they know the color of their hat. The third intellectual would see that the two intellectuals have the same color hat infront of them, and rule that color out, then they would hear the intellectual behind them say what color hat they were wearing, so the third intellectual would rule out that color and pick the remaining color. The second and first would just rule out the colors that the other intellectuals already said.

1st and 2nd are wearing the same color, I think. I can explain my thought process if necessary