Can you solve the $20 riddle? ft SMBC Comics' Zach Weinersmith

You could establish a code of volume. You use the visible light spectrum (red to purple), the color that’s closest to red on the spectrum gets a loud answer and the color closest to purple gets a quiet whisper of an answer. So in the case of green and purple, green would be loud and purple would be quiet (you could change out volume with pitch). So if the order went purple, green, green, and purple, the first person has a 50% chance of living but would yell his guess, the next person would know that their hat was green and would yell (because the third hat is green) green . Third person would whisper green letting the forth person know that they have purple. And so on…