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 2 times and lost 8 times.

  1. Goat
  2. Goat
  3. Goat
  4. Goat
  5. Car
  6. Goat
  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 341 times and lost 659 times.

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