<?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: How would this coin flip simulation work ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774386#M246121</link>
    <description>&lt;P&gt;Still a suckers game or at least not not for me.&lt;/P&gt;
&lt;P&gt;Expected winnings per play, assuming fair dice, is -$0.41666666...&lt;/P&gt;
&lt;P&gt;If you end up with more than 58.3333.... at the end of 100 plays you beat the house (a bit).&lt;/P&gt;</description>
    <pubDate>Thu, 14 Oct 2021 23:03:01 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-10-14T23:03:01Z</dc:date>
    <item>
      <title>How would this coin flip simulation work ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774366#M246110</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SAS 2.png" style="width: 791px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64735iE05FC22B3456B652/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS 2.png" alt="SAS 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;This is what I have so far.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data roll;
MyMoney=100;
	Die1 = ceil(6*ranuni(-1));
	Die2 = ceil(6*ranuni(-1));
sum = Die1+Die2;
if sum &amp;gt; 9 then MyMoney + 5;
else if sum &amp;lt; 9 then MyMoney - 2.50;


Run;

proc print data=roll;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Oct 2021 21:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774366#M246110</guid>
      <dc:creator>Godzilla_Hat</dc:creator>
      <dc:date>2021-10-14T21:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: How would this coin flip simulation work ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774367#M246111</link>
      <description>&lt;P&gt;Are you asking for help?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 21:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774367#M246111</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-14T21:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: How would this coin flip simulation work ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774370#M246113</link>
      <description>&lt;P&gt;Yes please&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 21:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774370#M246113</guid>
      <dc:creator>Godzilla_Hat</dc:creator>
      <dc:date>2021-10-14T21:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: How would this coin flip simulation work ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774374#M246114</link>
      <description>&lt;P&gt;How about something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;data RandInt;
length die1 8 die2 8 winnings 8 balance 8;
/* streaminit for reproducible sequence, comment out for different results */
call streaminit(123); 
retain balance 100;
do i = 1 to 100;
   die1 = rand("Integer", 1, 6);  /* requires SAS 9.4M5 or later */
   die2 = rand("Integer", 1, 6);  
   winnings = ifn(die1+die2&amp;gt;=9,5,-2.50);
   balance+winnings;
   output;
end;
drop i;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisHemedinger_0-1634249030927.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64739iF3EE244DAB1FB192/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChrisHemedinger_0-1634249030927.png" alt="ChrisHemedinger_0-1634249030927.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;At first I had payout when the total &amp;gt; 9 only, and that's a sucker's game. But corrected to &amp;gt;= 9 and it seems better.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 22:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774374#M246114</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2021-10-14T22:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: How would this coin flip simulation work ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774386#M246121</link>
      <description>&lt;P&gt;Still a suckers game or at least not not for me.&lt;/P&gt;
&lt;P&gt;Expected winnings per play, assuming fair dice, is -$0.41666666...&lt;/P&gt;
&lt;P&gt;If you end up with more than 58.3333.... at the end of 100 plays you beat the house (a bit).&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 23:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774386#M246121</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-14T23:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: How would this coin flip simulation work ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774387#M246122</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/397864"&gt;@Godzilla_Hat&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SAS 2.png" style="width: 791px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64735iE05FC22B3456B652/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS 2.png" alt="SAS 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why did you call this a "coin flip"? There are more than two outcomes per die and coins, barring the "lands on edge" event typically have only 2 outcomes.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 23:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-would-this-coin-flip-simulation-work/m-p/774387#M246122</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-14T23:05:10Z</dc:date>
    </item>
  </channel>
</rss>

