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. Car
  2. Car
  3. Goat
  4. Goat
  5. Goat
  6. Goat
  7. Car
  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 342 times and lost 658 times.

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