<?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 How can I tell if a uniform distribution converges under specific conditions? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-tell-if-a-uniform-distribution-converges-under/m-p/601177#M173845</link>
    <description>&lt;P&gt;&lt;SPAN style="color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;I need to use SAS to answer the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Suppose Xi for i=1, 2, 3… has uniform (0, 1) distribution. Let M = min (n: X1 + X2 + … + Xn&amp;gt; 1). Find expected value of M; E(M) = Mean of M. If there is convergence, why and what is the final answer. However, if there is divergence, explain.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I was able to generate E(M) with the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data prob1;
call streaminit (33);
do i=1 to 10000;
   sum=0 ;
   M=0 ;
   do until (sum&amp;gt;1) ;
      xuni = rand('uniform', 0, 1);
      sum+xuni;
      M+1 ;
   end ;
   output;
end;
run;
proc means data=prob1;
var M;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN style="color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;But I am completely lost as to whether or not there is convergence. I don't think I understand exactly what is expected of me. convergence of E(M)? I'm lost please help!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 02 Nov 2019 21:50:42 GMT</pubDate>
    <dc:creator>valarievil</dc:creator>
    <dc:date>2019-11-02T21:50:42Z</dc:date>
    <item>
      <title>How can I tell if a uniform distribution converges under specific conditions?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-tell-if-a-uniform-distribution-converges-under/m-p/601177#M173845</link>
      <description>&lt;P&gt;&lt;SPAN style="color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;I need to use SAS to answer the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Suppose Xi for i=1, 2, 3… has uniform (0, 1) distribution. Let M = min (n: X1 + X2 + … + Xn&amp;gt; 1). Find expected value of M; E(M) = Mean of M. If there is convergence, why and what is the final answer. However, if there is divergence, explain.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I was able to generate E(M) with the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data prob1;
call streaminit (33);
do i=1 to 10000;
   sum=0 ;
   M=0 ;
   do until (sum&amp;gt;1) ;
      xuni = rand('uniform', 0, 1);
      sum+xuni;
      M+1 ;
   end ;
   output;
end;
run;
proc means data=prob1;
var M;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN style="color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;But I am completely lost as to whether or not there is convergence. I don't think I understand exactly what is expected of me. convergence of E(M)? I'm lost please help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 21:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-tell-if-a-uniform-distribution-converges-under/m-p/601177#M173845</guid>
      <dc:creator>valarievil</dc:creator>
      <dc:date>2019-11-02T21:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I tell if a uniform distribution converges under specific conditions?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-tell-if-a-uniform-distribution-converges-under/m-p/601202#M173853</link>
      <description>&lt;P&gt;Play with the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data prob1;
call streaminit (33);
do k = 2 to 12;
	do rep = 1 to 8;
		do i = 1 to 2**k;
		    sum = 0 ;
		    M = 0 ;
		    do until (sum &amp;gt; 1) ;
		        xuni = rand('uniform', 0, 1);
		        sum + xuni;
		        M + 1;
		        end ;
		    output;
		 	end;
		end;
	end;
keep k rep M;
run;

proc summary data=prob1;
by k rep;
var M;
output out=prob2 mean=meanM;
run;

proc sgplot data=prob2;
scatter x=k y=meanM / jitter;
xaxis integer;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UniformConverge.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33607iF984CC6C22A3328F/image-size/large?v=v2&amp;amp;px=999" role="button" title="UniformConverge.png" alt="UniformConverge.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2019 04:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-tell-if-a-uniform-distribution-converges-under/m-p/601202#M173853</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-11-03T04:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I tell if a uniform distribution converges under specific conditions?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-tell-if-a-uniform-distribution-converges-under/m-p/601248#M173871</link>
      <description>&lt;P&gt;THANK YOU!&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2019 18:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-tell-if-a-uniform-distribution-converges-under/m-p/601248#M173871</guid>
      <dc:creator>valarievil</dc:creator>
      <dc:date>2019-11-03T18:54:30Z</dc:date>
    </item>
  </channel>
</rss>

