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. Car
  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 337 times and lost 663 times.

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

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 93 times and lost 907 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 35 times and lost 65 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;
	}
}