💡 SCIENCE BEHIND THE ILLUSION:
The 100th prisoner (at the back) counts the number of black hats in front of him. If even, he yells 'Black'; if odd, he yells 'Red' (a parity bit!). He has a 50% chance of survival, but every subsequent prisoner can deduce their exact hat color from the parity tally and preceding calls!