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 4 times and lost 6 times.

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

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 348 times and lost 652 times.

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