Riddle Thread

is it log(2)n?

they're gonna agree for the following
red = odd number of blue hats in front of him
blue = even number of blue hats in front of him
first guy has 50%, the rest have 100% chance of getting it right. last guy will know his hat color by the guy behind him
works for any hat arrangement. fuck you niggers.

how did it take so long…