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

  1. Goat
  2. Goat
  3. Car
  4. Car
  5. Goat
  6. Car
  7. Car
  8. Goat
  9. Car
  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 336 times and lost 664 times.

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