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. Car
  3. Goat
  4. Goat
  5. Car
  6. Goat
  7. Goat
  8. Car
  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 317 times and lost 683 times.

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