<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Monty Hall Problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525110#M142869</link>
    <description>&lt;P&gt;IML solution&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/04/01/monty-hall.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2015/04/01/monty-hall.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data step approach - Single iteration&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Monty_Hall,_Paul_Erd%C3%B6s,_and_Monte_Carlo" target="_blank"&gt;http://www.sascommunity.org/wiki/Monty_Hall,_Paul_Erd%C3%B6s,_and_Monte_Carlo&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS &amp;amp; Python&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2016/10/12/the-monty-hall-paradox-sas-vs-python/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2016/10/12/the-monty-hall-paradox-sas-vs-python/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253720"&gt;@Stacy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Please can anyone help me with this question.&lt;/P&gt;
&lt;DIV&gt;The Monty Hall problem is named for its similarity to the Let's Make a Deal television&lt;/DIV&gt;
&lt;DIV&gt;game show hosted by Monty Hall.&lt;/DIV&gt;
&lt;DIV&gt;The problem is stated as follows. Assume that a room is equipped with three doors.&lt;/DIV&gt;
&lt;DIV&gt;Behind two are goats, and behind the third is a car.&lt;/DIV&gt;
&lt;DIV&gt;You are asked to pick a door, and will win whatever is behind it.&lt;/DIV&gt;
&lt;DIV&gt;Let's say you pick door1. Before the door is opened, however, someone who knows what's behind the doors&lt;/DIV&gt;
&lt;DIV&gt;(Monty Hall) opens one of the other&lt;/DIV&gt;
&lt;DIV&gt;two doors, revealing a goat, and asks you if you wish&lt;/DIV&gt;
&lt;DIV&gt;to change your selection to the third door (i.e., the door which neither you picked nor he&lt;/DIV&gt;
&lt;DIV&gt;opened).&lt;/DIV&gt;
&lt;DIV&gt;The Monty Hall problem is deciding whether&lt;/DIV&gt;
&lt;DIV&gt;you&lt;/DIV&gt;
&lt;DIV&gt;change your selection or not&lt;/DIV&gt;
&lt;DIV&gt;that has a better chance of winning the car&lt;/DIV&gt;
&lt;DIV&gt;.&lt;/DIV&gt;
&lt;DIV&gt;It’s common sense that if not to change, the&lt;/DIV&gt;
&lt;DIV&gt;probability of winning is 1/3 but what about changing the selection.&lt;/DIV&gt;
&lt;DIV&gt;Simulating this game using SAS, for each round, program the fol&lt;/DIV&gt;
&lt;DIV&gt;lowing,&lt;/DIV&gt;
&lt;DIV&gt;1)&lt;/DIV&gt;
&lt;DIV&gt;Assigning two goats and a car to three doors randomly&lt;/DIV&gt;
&lt;DIV&gt;2)&lt;/DIV&gt;
&lt;DIV&gt;Picking a door randomly&lt;/DIV&gt;
&lt;DIV&gt;3)&lt;/DIV&gt;
&lt;DIV&gt;Picking one of the two remaining doors to open but must showing the goat&lt;/DIV&gt;
&lt;DIV&gt;4)&lt;/DIV&gt;
&lt;DIV&gt;Changing the selection to the remaining door&lt;/DIV&gt;
&lt;DIV&gt;5)&lt;/DIV&gt;
&lt;DIV&gt;Deciding the result&lt;/DIV&gt;
&lt;DIV&gt;Repeating these steps for 100&lt;/DIV&gt;
&lt;DIV&gt;rounds&lt;/DIV&gt;
&lt;DIV&gt;,&lt;/DIV&gt;
&lt;DIV&gt;generating a data set including the following five&lt;/DIV&gt;
&lt;DIV&gt;variables, the round number, the door the car is in, the door chosen initially, the door&lt;/DIV&gt;
&lt;DIV&gt;chosen after switching,&lt;/DIV&gt;
&lt;DIV&gt;and&lt;/DIV&gt;
&lt;DIV&gt;the result(win/lose). Showing the data set and reporting the&lt;/DIV&gt;
&lt;DIV&gt;frequency&lt;/DIV&gt;
&lt;DIV&gt;of the initial door chosen, the frequency of the door chosen at the end, the&lt;/DIV&gt;
&lt;DIV&gt;average rate of winning.&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jan 2019 16:51:49 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-01-07T16:51:49Z</dc:date>
    <item>
      <title>Monty Hall Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525102#M142865</link>
      <description>&lt;P&gt;Please can anyone help me with this question.&lt;/P&gt;&lt;DIV&gt;The Monty Hall problem is named for its similarity to the Let's Make a Deal television&lt;/DIV&gt;&lt;DIV&gt;game show hosted by Monty Hall.&lt;/DIV&gt;&lt;DIV&gt;The problem is stated as follows. Assume that a room is equipped with three doors.&lt;/DIV&gt;&lt;DIV&gt;Behind two are goats, and behind the third is a car.&lt;/DIV&gt;&lt;DIV&gt;You are asked to pick a door, and will win whatever is behind it.&lt;/DIV&gt;&lt;DIV&gt;Let's say you pick door1. Before the door is opened, however, someone who knows what's behind the doors&lt;/DIV&gt;&lt;DIV&gt;(Monty Hall) opens one of the other&lt;/DIV&gt;&lt;DIV&gt;two doors, revealing a goat, and asks you if you wish&lt;/DIV&gt;&lt;DIV&gt;to change your selection to the third door (i.e., the door which neither you picked nor he&lt;/DIV&gt;&lt;DIV&gt;opened).&lt;/DIV&gt;&lt;DIV&gt;The Monty Hall problem is deciding whether&lt;/DIV&gt;&lt;DIV&gt;you&lt;/DIV&gt;&lt;DIV&gt;change your selection or not&lt;/DIV&gt;&lt;DIV&gt;that has a better chance of winning the car&lt;/DIV&gt;&lt;DIV&gt;.&lt;/DIV&gt;&lt;DIV&gt;It’s common sense that if not to change, the&lt;/DIV&gt;&lt;DIV&gt;probability of winning is 1/3 but what about changing the selection.&lt;/DIV&gt;&lt;DIV&gt;Simulating this game using SAS, for each round, program the fol&lt;/DIV&gt;&lt;DIV&gt;lowing,&lt;/DIV&gt;&lt;DIV&gt;1)&lt;/DIV&gt;&lt;DIV&gt;Assigning two goats and a car to three doors randomly&lt;/DIV&gt;&lt;DIV&gt;2)&lt;/DIV&gt;&lt;DIV&gt;Picking a door randomly&lt;/DIV&gt;&lt;DIV&gt;3)&lt;/DIV&gt;&lt;DIV&gt;Picking one of the two remaining doors to open but must showing the goat&lt;/DIV&gt;&lt;DIV&gt;4)&lt;/DIV&gt;&lt;DIV&gt;Changing the selection to the remaining door&lt;/DIV&gt;&lt;DIV&gt;5)&lt;/DIV&gt;&lt;DIV&gt;Deciding the result&lt;/DIV&gt;&lt;DIV&gt;Repeating these steps for 100&lt;/DIV&gt;&lt;DIV&gt;rounds&lt;/DIV&gt;&lt;DIV&gt;,&lt;/DIV&gt;&lt;DIV&gt;generating a data set including the following five&lt;/DIV&gt;&lt;DIV&gt;variables, the round number, the door the car is in, the door chosen initially, the door&lt;/DIV&gt;&lt;DIV&gt;chosen after switching,&lt;/DIV&gt;&lt;DIV&gt;and&lt;/DIV&gt;&lt;DIV&gt;the result(win/lose). Showing the data set and reporting the&lt;/DIV&gt;&lt;DIV&gt;frequency&lt;/DIV&gt;&lt;DIV&gt;of the initial door chosen, the frequency of the door chosen at the end, the&lt;/DIV&gt;&lt;DIV&gt;average rate of winning.&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:31:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525102#M142865</guid>
      <dc:creator>Stacy</dc:creator>
      <dc:date>2019-01-07T16:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Monty Hall Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525105#M142866</link>
      <description>&lt;P&gt;There are plenty of explanations/solutions of the Monty Hall problem out there on the internet, including Wikipedia.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it isn't clear why you are posting this in a SAS forum. Are you trying to simulate the results? What is the actual question you are asking?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525105#M142866</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-07T16:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Monty Hall Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525106#M142867</link>
      <description>&lt;P&gt;I am stuck on writing a code to assign two goats and a car to three doors randomly. I'm just not sure about the right code for this particular one&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525106#M142867</guid>
      <dc:creator>Stacy</dc:creator>
      <dc:date>2019-01-07T16:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Monty Hall Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525107#M142868</link>
      <description>&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/04/01/monty-hall.html" target="_self"&gt;This&lt;/A&gt;&amp;nbsp;is a nice starting point.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525107#M142868</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-07T16:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Monty Hall Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525110#M142869</link>
      <description>&lt;P&gt;IML solution&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/04/01/monty-hall.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2015/04/01/monty-hall.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data step approach - Single iteration&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Monty_Hall,_Paul_Erd%C3%B6s,_and_Monte_Carlo" target="_blank"&gt;http://www.sascommunity.org/wiki/Monty_Hall,_Paul_Erd%C3%B6s,_and_Monte_Carlo&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS &amp;amp; Python&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2016/10/12/the-monty-hall-paradox-sas-vs-python/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2016/10/12/the-monty-hall-paradox-sas-vs-python/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253720"&gt;@Stacy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Please can anyone help me with this question.&lt;/P&gt;
&lt;DIV&gt;The Monty Hall problem is named for its similarity to the Let's Make a Deal television&lt;/DIV&gt;
&lt;DIV&gt;game show hosted by Monty Hall.&lt;/DIV&gt;
&lt;DIV&gt;The problem is stated as follows. Assume that a room is equipped with three doors.&lt;/DIV&gt;
&lt;DIV&gt;Behind two are goats, and behind the third is a car.&lt;/DIV&gt;
&lt;DIV&gt;You are asked to pick a door, and will win whatever is behind it.&lt;/DIV&gt;
&lt;DIV&gt;Let's say you pick door1. Before the door is opened, however, someone who knows what's behind the doors&lt;/DIV&gt;
&lt;DIV&gt;(Monty Hall) opens one of the other&lt;/DIV&gt;
&lt;DIV&gt;two doors, revealing a goat, and asks you if you wish&lt;/DIV&gt;
&lt;DIV&gt;to change your selection to the third door (i.e., the door which neither you picked nor he&lt;/DIV&gt;
&lt;DIV&gt;opened).&lt;/DIV&gt;
&lt;DIV&gt;The Monty Hall problem is deciding whether&lt;/DIV&gt;
&lt;DIV&gt;you&lt;/DIV&gt;
&lt;DIV&gt;change your selection or not&lt;/DIV&gt;
&lt;DIV&gt;that has a better chance of winning the car&lt;/DIV&gt;
&lt;DIV&gt;.&lt;/DIV&gt;
&lt;DIV&gt;It’s common sense that if not to change, the&lt;/DIV&gt;
&lt;DIV&gt;probability of winning is 1/3 but what about changing the selection.&lt;/DIV&gt;
&lt;DIV&gt;Simulating this game using SAS, for each round, program the fol&lt;/DIV&gt;
&lt;DIV&gt;lowing,&lt;/DIV&gt;
&lt;DIV&gt;1)&lt;/DIV&gt;
&lt;DIV&gt;Assigning two goats and a car to three doors randomly&lt;/DIV&gt;
&lt;DIV&gt;2)&lt;/DIV&gt;
&lt;DIV&gt;Picking a door randomly&lt;/DIV&gt;
&lt;DIV&gt;3)&lt;/DIV&gt;
&lt;DIV&gt;Picking one of the two remaining doors to open but must showing the goat&lt;/DIV&gt;
&lt;DIV&gt;4)&lt;/DIV&gt;
&lt;DIV&gt;Changing the selection to the remaining door&lt;/DIV&gt;
&lt;DIV&gt;5)&lt;/DIV&gt;
&lt;DIV&gt;Deciding the result&lt;/DIV&gt;
&lt;DIV&gt;Repeating these steps for 100&lt;/DIV&gt;
&lt;DIV&gt;rounds&lt;/DIV&gt;
&lt;DIV&gt;,&lt;/DIV&gt;
&lt;DIV&gt;generating a data set including the following five&lt;/DIV&gt;
&lt;DIV&gt;variables, the round number, the door the car is in, the door chosen initially, the door&lt;/DIV&gt;
&lt;DIV&gt;chosen after switching,&lt;/DIV&gt;
&lt;DIV&gt;and&lt;/DIV&gt;
&lt;DIV&gt;the result(win/lose). Showing the data set and reporting the&lt;/DIV&gt;
&lt;DIV&gt;frequency&lt;/DIV&gt;
&lt;DIV&gt;of the initial door chosen, the frequency of the door chosen at the end, the&lt;/DIV&gt;
&lt;DIV&gt;average rate of winning.&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525110#M142869</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T16:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Monty Hall Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525125#M142873</link>
      <description>&lt;P&gt;While I realize this is a homework problem ... the mathematician in me wants to say that the best and most convincing solution does not involve any simulation at all. This problem can be&amp;nbsp;solved simply by computing probabilities of each event.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 18:12:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525125#M142873</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-07T18:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Monty Hall Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525126#M142874</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253720"&gt;@Stacy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am stuck on writing a code to assign two goats and a car to three doors randomly. I'm just not sure about the right code for this particular one&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use this code to generate a number of randomizations of the prize.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc plan ordered seed=89768;
   factors rep=10 door=3 / noprint;
   treatment prize=3 random;
   output out=want prize cvals=('Goat' 'Goat' 'Car');
   run;
   quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 17:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Monty-Hall-Problem/m-p/525126#M142874</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-01-07T17:43:10Z</dc:date>
    </item>
  </channel>
</rss>

