#!/bin/gawk -f # Monty Hall problem BEGIN { srand() doors = 3 iterations = 10000 # Behind a door: EMPTY = "empty"; PRIZE = "prize" # Algorithm used KEEP = "keep"; SWITCH="switch"; RAND="random"; # } function monty_hall( choice, algorithm ) { # Set up doors for ( i=0; i