n = 10_000                  

stay = switch = 0           

n.times do                  

  
  doors = [ :goat, :goat, :car ].shuffle

  
  guess = rand(3)

  
  begin shown = rand(3) end while shown == guess || doors[shown] == :car

  if doors[guess] == :car
    
    stay += 1
  else
    
    switch += 1
  end

end

puts    % (100.0 * stay   / n)
puts  % (100.0 * switch / n)