<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3429" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: PT-BR"><FONT
size=2>Tenho este algoritmo<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: PT-BR"><FONT
size=2>p=1, N=0, c=e^-lambda<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: PT-BR"><FONT
size=2>Repita <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: PT-BR"><FONT
size=2><SPAN
style="mso-spacerun: yes"> </SPAN>N=N+1<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: PT-BR"><FONT
size=2>gere Ui<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: PT-BR"><FONT
size=2>atualize p<c.e^-lambda<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: PT-BR"><FONT
size=2>Faça X=N-1<o:p></o:p></FONT></SPAN></P></FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>Estou fazendo esta rotina abaixo, mas o resultado não está
consistente! Qual o melhor jeito?</FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=3>p=1<BR>n=0<BR>lambda=2<BR>c=exp(-lambda)<BR> for(n in 1:100){
<BR> u=runif(n)<BR> p=p*u<BR>p<c <BR>}<BR>x=n-1</FONT><BR> </FONT></DIV></BODY></HTML>