Goat or Car? Game Show Simulator

A player is presented with three doors. Behind one door is a new car. The other two doors conceal a goat. The player chooses a door then the host reveals a goat behind one of the two remaining doors. Should the player maintain his choice or switch to the only remaining door?

My intuition suggested that once the other goat was revealed that it became a simple 50% chance that the player had chosen correctly and, therefore, there would be no statistical benefit in changing their mind. In the simulation below, the player always sticks with their original choice.

Player won 1 time and lost 9 times.

  1. Goat
  2. Goat
  3. Goat
  4. Goat
  5. Goat
  6. Goat
  7. Goat
  8. Goat
  9. Goat
  10. Car

Every refresh of this page runs the test again so you will see variation in results. Of course, 10 iterations are statistically insignificant. A simulation of 1,000 iterations makes the ratio clearer:

Player won 361 times and lost 639 times.

  1. Car
  2. Car
  3. Goat
  4. Goat
  5. Car
  6. Goat
  7. Goat
  8. Car
  9. Goat
  10. Goat
  11. Car
  12. Goat
  13. Car
  14. Car
  15. Goat
  16. Goat
  17. Goat
  18. Goat
  19. Goat
  20. Car
  21. Car
  22. Goat
  23. Car
  24. Goat
  25. Goat
  26. Goat
  27. Car
  28. Car
  29. Goat
  30. Goat
  31. Car
  32. Goat
  33. Car
  34. Goat
  35. Car
  36. Car
  37. Goat
  38. Car
  39. Goat
  40. Goat
  41. Goat
  42. Goat
  43. Goat
  44. Car
  45. Goat
  46. Car
  47. Car
  48. Car
  49. Car
  50. Car
  51. Goat
  52. Car
  53. Goat
  54. Car
  55. Goat
  56. Goat
  57. Car
  58. Car
  59. Car
  60. Car
  61. Goat
  62. Car
  63. Goat
  64. Goat
  65. Car
  66. Goat
  67. Car
  68. Goat
  69. Goat
  70. Goat
  71. Goat
  72. Car
  73. Goat
  74. Car
  75. Goat
  76. Car
  77. Goat
  78. Car
  79. Car
  80. Goat
  81. Goat
  82. Goat
  83. Car
  84. Car
  85. Goat
  86. Goat
  87. Car
  88. Goat
  89. Goat
  90. Goat
  91. Goat
  92. Goat
  93. Goat
  94. Car
  95. Car
  96. Car
  97. Goat
  98. Goat
  99. Car
  100. Goat
  101. Goat
  102. Goat
  103. Goat
  104. Goat
  105. Car
  106. Goat
  107. Car
  108. Car
  109. Goat
  110. Car
  111. Car
  112. Car
  113. Car
  114. Goat
  115. Car
  116. Car
  117. Car
  118. Car
  119. Goat
  120. Car
  121. Car
  122. Goat
  123. Goat
  124. Goat
  125. Car
  126. Goat
  127. Goat
  128. Car
  129. Goat
  130. Goat
  131. Goat
  132. Car
  133. Goat
  134. Goat
  135. Goat
  136. Car
  137. Goat
  138. Car
  139. Car
  140. Goat
  141. Goat
  142. Car
  143. Goat
  144. Car
  145. Goat
  146. Goat
  147. Goat
  148. Car
  149. Goat
  150. Goat
  151. Goat
  152. Goat
  153. Car
  154. Goat
  155. Goat
  156. Goat
  157. Goat
  158. Goat
  159. Car
  160. Goat
  161. Goat
  162. Car
  163. Goat
  164. Goat
  165. Goat
  166. Car
  167. Goat
  168. Goat
  169. Goat
  170. Goat
  171. Goat
  172. Goat
  173. Goat
  174. Car
  175. Goat
  176. Goat
  177. Goat
  178. Goat
  179. Goat
  180. Goat
  181. Goat
  182. Car
  183. Car
  184. Car
  185. Car
  186. Car
  187. Car
  188. Car
  189. Goat
  190. Goat
  191. Goat
  192. Goat
  193. Goat
  194. Car
  195. Car
  196. Goat
  197. Car
  198. Car
  199. Goat
  200. Car
  201. Car
  202. Goat
  203. Goat
  204. Car
  205. Goat
  206. Goat
  207. Goat
  208. Goat
  209. Goat
  210. Goat
  211. Goat
  212. Goat
  213. Car
  214. Goat
  215. Goat
  216. Goat
  217. Goat
  218. Car
  219. Goat
  220. Goat
  221. Car
  222. Goat
  223. Goat
  224. Car
  225. Goat
  226. Car
  227. Car
  228. Goat
  229. Car
  230. Car
  231. Goat
  232. Car
  233. Car
  234. Goat
  235. Goat
  236. Car
  237. Goat
  238. Goat
  239. Car
  240. Goat
  241. Goat
  242. Car
  243. Goat
  244. Goat
  245. Goat
  246. Car
  247. Car
  248. Goat
  249. Goat
  250. Goat
  251. Car
  252. Goat
  253. Goat
  254. Car
  255. Goat
  256. Goat
  257. Car
  258. Car
  259. Goat
  260. Goat
  261. Car
  262. Goat
  263. Goat
  264. Car
  265. Goat
  266. Goat
  267. Goat
  268. Car
  269. Car
  270. Goat
  271. Car
  272. Goat
  273. Goat
  274. Goat
  275. Goat
  276. Goat
  277. Goat
  278. Goat
  279. Car
  280. Car
  281. Goat
  282. Goat
  283. Car
  284. Goat
  285. Goat
  286. Goat
  287. Goat
  288. Car
  289. Car
  290. Goat
  291. Goat
  292. Goat
  293. Car
  294. Goat
  295. Car
  296. Car
  297. Car
  298. Car
  299. Car
  300. Goat
  301. Car
  302. Goat
  303. Goat
  304. Goat
  305. Goat
  306. Car
  307. Goat
  308. Goat
  309. Goat
  310. Goat
  311. Goat
  312. Goat
  313. Goat
  314. Goat
  315. Goat
  316. Goat
  317. Goat
  318. Goat
  319. Car
  320. Goat
  321. Goat
  322. Car
  323. Goat
  324. Goat
  325. Car
  326. Car
  327. Car
  328. Car
  329. Goat
  330. Goat
  331. Car
  332. Goat
  333. Car
  334. Car
  335. Goat
  336. Goat
  337. Goat
  338. Car
  339. Car
  340. Goat
  341. Goat
  342. Goat
  343. Goat
  344. Goat
  345. Goat
  346. Car
  347. Goat
  348. Goat
  349. Car
  350. Goat
  351. Goat
  352. Car
  353. Goat
  354. Goat
  355. Goat
  356. Car
  357. Goat
  358. Goat
  359. Car
  360. Car
  361. Car
  362. Car
  363. Goat
  364. Goat
  365. Goat
  366. Car
  367. Goat
  368. Goat
  369. Goat
  370. Car
  371. Goat
  372. Goat
  373. Goat
  374. Car
  375. Goat
  376. Goat
  377. Goat
  378. Goat
  379. Goat
  380. Car
  381. Goat
  382. Goat
  383. Goat
  384. Goat
  385. Car
  386. Car
  387. Goat
  388. Goat
  389. Goat
  390. Car
  391. Goat
  392. Goat
  393. Car
  394. Car
  395. Goat
  396. Car
  397. Goat
  398. Goat
  399. Goat
  400. Goat
  401. Goat
  402. Car
  403. Goat
  404. Goat
  405. Goat
  406. Car
  407. Car
  408. Goat
  409. Car
  410. Goat
  411. Car
  412. Car
  413. Goat
  414. Car
  415. Car
  416. Car
  417. Car
  418. Goat
  419. Car
  420. Goat
  421. Goat
  422. Goat
  423. Goat
  424. Car
  425. Goat
  426. Goat
  427. Car
  428. Goat
  429. Goat
  430. Car
  431. Goat
  432. Goat
  433. Goat
  434. Car
  435. Goat
  436. Goat
  437. Goat
  438. Goat
  439. Car
  440. Goat
  441. Goat
  442. Car
  443. Car
  444. Goat
  445. Car
  446. Goat
  447. Goat
  448. Car
  449. Car
  450. Goat
  451. Goat
  452. Car
  453. Car
  454. Goat
  455. Goat
  456. Goat
  457. Goat
  458. Car
  459. Goat
  460. Car
  461. Goat
  462. Goat
  463. Goat
  464. Goat
  465. Car
  466. Car
  467. Goat
  468. Goat
  469. Car
  470. Goat
  471. Goat
  472. Car
  473. Goat
  474. Car
  475. Goat
  476. Car
  477. Goat
  478. Goat
  479. Goat
  480. Goat
  481. Goat
  482. Car
  483. Goat
  484. Car
  485. Car
  486. Car
  487. Car
  488. Goat
  489. Car
  490. Goat
  491. Goat
  492. Car
  493. Goat
  494. Goat
  495. Goat
  496. Goat
  497. Car
  498. Goat
  499. Goat
  500. Goat
  501. Car
  502. Car
  503. Goat
  504. Goat
  505. Car
  506. Goat
  507. Goat
  508. Car
  509. Goat
  510. Goat
  511. Car
  512. Goat
  513. Goat
  514. Goat
  515. Goat
  516. Car
  517. Goat
  518. Goat
  519. Car
  520. Goat
  521. Goat
  522. Goat
  523. Goat
  524. Goat
  525. Goat
  526. Goat
  527. Goat
  528. Goat
  529. Goat
  530. Goat
  531. Car
  532. Goat
  533. Goat
  534. Goat
  535. Car
  536. Goat
  537. Car
  538. Goat
  539. Goat
  540. Car
  541. Car
  542. Car
  543. Goat
  544. Goat
  545. Car
  546. Goat
  547. Car
  548. Car
  549. Car
  550. Goat
  551. Car
  552. Car
  553. Goat
  554. Car
  555. Goat
  556. Goat
  557. Goat
  558. Goat
  559. Goat
  560. Goat
  561. Car
  562. Goat
  563. Car
  564. Goat
  565. Goat
  566. Goat
  567. Goat
  568. Car
  569. Goat
  570. Car
  571. Car
  572. Car
  573. Goat
  574. Car
  575. Goat
  576. Car
  577. Car
  578. Goat
  579. Goat
  580. Car
  581. Goat
  582. Car
  583. Car
  584. Car
  585. Goat
  586. Car
  587. Goat
  588. Car
  589. Goat
  590. Goat
  591. Goat
  592. Goat
  593. Car
  594. Goat
  595. Goat
  596. Goat
  597. Goat
  598. Car
  599. Goat
  600. Goat
  601. Goat
  602. Goat
  603. Car
  604. Car
  605. Car
  606. Goat
  607. Goat
  608. Goat
  609. Car
  610. Goat
  611. Goat
  612. Goat
  613. Goat
  614. Car
  615. Goat
  616. Goat
  617. Goat
  618. Goat
  619. Goat
  620. Goat
  621. Goat
  622. Goat
  623. Goat
  624. Goat
  625. Car
  626. Car
  627. Car
  628. Goat
  629. Goat
  630. Goat
  631. Car
  632. Car
  633. Car
  634. Car
  635. Car
  636. Goat
  637. Car
  638. Car
  639. Car
  640. Goat
  641. Goat
  642. Goat
  643. Car
  644. Goat
  645. Goat
  646. Car
  647. Goat
  648. Car
  649. Goat
  650. Car
  651. Goat
  652. Goat
  653. Car
  654. Goat
  655. Goat
  656. Car
  657. Car
  658. Goat
  659. Goat
  660. Goat
  661. Car
  662. Goat
  663. Goat
  664. Goat
  665. Car
  666. Goat
  667. Goat
  668. Goat
  669. Goat
  670. Goat
  671. Goat
  672. Goat
  673. Goat
  674. Goat
  675. Goat
  676. Goat
  677. Goat
  678. Goat
  679. Car
  680. Car
  681. Car
  682. Car
  683. Car
  684. Car
  685. Goat
  686. Goat
  687. Car
  688. Goat
  689. Goat
  690. Goat
  691. Goat
  692. Car
  693. Goat
  694. Goat
  695. Car
  696. Goat
  697. Car
  698. Car
  699. Goat
  700. Car
  701. Goat
  702. Goat
  703. Goat
  704. Goat
  705. Goat
  706. Goat
  707. Goat
  708. Goat
  709. Goat
  710. Goat
  711. Car
  712. Goat
  713. Car
  714. Goat
  715. Car
  716. Goat
  717. Car
  718. Goat
  719. Goat
  720. Goat
  721. Goat
  722. Goat
  723. Car
  724. Goat
  725. Car
  726. Goat
  727. Goat
  728. Goat
  729. Goat
  730. Goat
  731. Goat
  732. Car
  733. Car
  734. Car
  735. Goat
  736. Goat
  737. Goat
  738. Car
  739. Goat
  740. Car
  741. Car
  742. Goat
  743. Goat
  744. Goat
  745. Car
  746. Goat
  747. Goat
  748. Car
  749. Goat
  750. Goat
  751. Car
  752. Car
  753. Goat
  754. Car
  755. Goat
  756. Goat
  757. Car
  758. Goat
  759. Goat
  760. Goat
  761. Car
  762. Goat
  763. Car
  764. Goat
  765. Car
  766. Car
  767. Goat
  768. Goat
  769. Car
  770. Goat
  771. Car
  772. Goat
  773. Goat
  774. Car
  775. Goat
  776. Goat
  777. Car
  778. Goat
  779. Goat
  780. Goat
  781. Goat
  782. Goat
  783. Goat
  784. Car
  785. Goat
  786. Goat
  787. Car
  788. Goat
  789. Car
  790. Car
  791. Goat
  792. Goat
  793. Car
  794. Goat
  795. Car
  796. Car
  797. Car
  798. Goat
  799. Goat
  800. Car
  801. Goat
  802. Goat
  803. Goat
  804. Goat
  805. Goat
  806. Car
  807. Goat
  808. Goat
  809. Goat
  810. Car
  811. Goat
  812. Goat
  813. Goat
  814. Goat
  815. Goat
  816. Goat
  817. Goat
  818. Goat
  819. Goat
  820. Goat
  821. Goat
  822. Goat
  823. Goat
  824. Goat
  825. Goat
  826. Goat
  827. Car
  828. Car
  829. Car
  830. Goat
  831. Goat
  832. Goat
  833. Goat
  834. Goat
  835. Car
  836. Car
  837. Car
  838. Goat
  839. Goat
  840. Goat
  841. Car
  842. Car
  843. Car
  844. Car
  845. Goat
  846. Goat
  847. Goat
  848. Goat
  849. Goat
  850. Goat
  851. Goat
  852. Car
  853. Car
  854. Goat
  855. Goat
  856. Goat
  857. Goat
  858. Goat
  859. Car
  860. Goat
  861. Goat
  862. Car
  863. Goat
  864. Goat
  865. Goat
  866. Goat
  867. Goat
  868. Car
  869. Car
  870. Goat
  871. Goat
  872. Goat
  873. Goat
  874. Goat
  875. Goat
  876. Goat
  877. Goat
  878. Goat
  879. Goat
  880. Car
  881. Car
  882. Car
  883. Goat
  884. Goat
  885. Car
  886. Car
  887. Car
  888. Goat
  889. Car
  890. Goat
  891. Goat
  892. Car
  893. Car
  894. Goat
  895. Goat
  896. Goat
  897. Goat
  898. Car
  899. Goat
  900. Goat
  901. Goat
  902. Goat
  903. Goat
  904. Car
  905. Goat
  906. Goat
  907. Goat
  908. Goat
  909. Goat
  910. Goat
  911. Car
  912. Car
  913. Goat
  914. Car
  915. Car
  916. Goat
  917. Goat
  918. Goat
  919. Goat
  920. Goat
  921. Car
  922. Car
  923. Goat
  924. Goat
  925. Goat
  926. Goat
  927. Car
  928. Goat
  929. Goat
  930. Car
  931. Goat
  932. Car
  933. Car
  934. Goat
  935. Goat
  936. Goat
  937. Car
  938. Goat
  939. Goat
  940. Goat
  941. Goat
  942. Goat
  943. Goat
  944. Goat
  945. Goat
  946. Car
  947. Goat
  948. Car
  949. Goat
  950. Goat
  951. Goat
  952. Car
  953. Car
  954. Car
  955. Car
  956. Goat
  957. Goat
  958. Goat
  959. Goat
  960. Car
  961. Car
  962. Car
  963. Car
  964. Goat
  965. Goat
  966. Goat
  967. Goat
  968. Goat
  969. Car
  970. Goat
  971. Goat
  972. Goat
  973. Car
  974. Car
  975. Goat
  976. Car
  977. Goat
  978. Goat
  979. Goat
  980. Goat
  981. Car
  982. Car
  983. Goat
  984. Goat
  985. Car
  986. Car
  987. Car
  988. Goat
  989. Car
  990. Goat
  991. Car
  992. Goat
  993. Goat
  994. Goat
  995. Car
  996. Goat
  997. Goat
  998. Goat
  999. Goat
  1000. Goat

But what if there were 10 doors with nine goats and one car? The game would still work the same where the player picks one door, and the host reveals 8 goats. Should the player switch? Here is a 1,000 iteration simulation where there are 10 doors and the player always sticks with their original choice:

Player won 118 times and lost 882 times.

So clearly, the number of doors influences the probability that the player would be better of by switching to the other remaining door.

Would you like to run a simulation? Enter your variables below:

How many doors?

How many iterations?

Should the player stay with their original choice?
Yes     No

Show images?
Yes     No

Custom test result

Player won 36 times and lost 64 times.

Methodology

This page uses the following PHP function to run the simulations:

function runTest($iterations, $number_of_doors=3, $player_stays=true, $show_pictures=false){

	// sanitize iterations
	$iterations = (int) preg_replace("/[^0-9]/","",$iterations);
	$iterations = ($iterations < 1)? 10 : $iterations;
	$iterations = ($iterations > 10000)? 10000 : $iterations;

	// sanitize number_of_doors
	$number_of_doors = (int) preg_replace("/[^0-9]/","",$number_of_doors);
	$number_of_doors = ($number_of_doors < 3)? 3 : $number_of_doors;
	$number_of_doors = ($number_of_doors > 10000)? 10000 : $number_of_doors;

	// generate a standard array
	$doors_original[0] = 'car';
	for($i=1; $i < $number_of_doors ; $i++){
		$doors_original[$i] = 'goat';
	}
	
	// initialize our scores
	$losses = 0; $wins = 0;
	
	// decide how big the images will be
	if($iterations >= 1000){
		$size = '24';
	} else if($iterations >= 100){
		$size = '32';
	} else {
		$size = '64';
	}
	
	$output = '<ol>';
	for($i=0; $i<$iterations; $i++){
		// make a temporary copy for this usage
		$doors = $doors_original;
		
		// shuffle the array
		shuffle($doors);
		
		// player always picks door number 1
		$players_first_choice = $doors[0];
		
		// did the player win?
		if($players_first_choice == 'car' && $player_stays==true){
			$output .= '<li class="c'.$size.'"><b>Car</b></li>';
			$wins++;
		} else if($players_first_choice == 'goat' && $player_stays==true){
			$output .= '<li class="g'.$size.'"><i>Goat</i></li>';
			$losses++;
		} else if($players_first_choice == 'car' && $player_stays==false){
			$output .= '<li class="g'.$size.'"><i>Goat</i></li>';
			$losses++;
		} else if($players_first_choice == 'goat' && $player_stays==false){
			$output .= '<li class="c'.$size.'"><b>Car</b></li>';
			$wins++;
		}
	}
	$output .= '</ol><div class="clear"> </div>';
	
	echo '<h3>Player won '.$wins.' time'.(($wins >1)? 's':'').
	     ' and lost '.$losses.' time'.(($losses >1)? 's':'').'.</h3>';
	if($show_pictures){
		echo $output;
	}
}