[R] Need some help

2007-10-14 Thread azzza
Hi! I'm taking a course that requires some programming background, but I'm a complete novice in the field. when asked to generate a list of 20 uniform random numbers, is it alright if I put in >randu, and just copy-paste the first 20 numbers?? Or is there, as I suspect, a better way of calling ou

Re: [R] Need some help

2007-10-15 Thread azzza
: > >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> On Behalf >> Of azzza >> Sent: Sunday, October 14, 2007 10:21 PM >> To: r-help@r-project.org >> Subject: [R] Need some help >> >> >> Hi! >> I&#

Re: [R] Need some help

2007-10-15 Thread azzza
-1 1 -1 1 -1 1 -1 1 ... > > Here was a sample of 1000, and there were 483 changes between the > samples. Is this what you are looking for? > > On 10/15/07, azzza <[EMAIL PROTECTED]> wrote: >> >> >> Quite helpful indeed. Greatly appreciated. >> Another probl

Re: [R] Need some help

2007-10-15 Thread azzza
0+60 > 2 | > 3 | 0 > 3 | > 4 | 00 > 4 | > 5 | 0 > 5 | > 6 | > 6 | > 7 | 0 > > With R, almost an

Re: [R] Need some help

2007-10-16 Thread azzza
and a plot of sign changes versus toss number (from toss #0 to toss number 1000). The Y axis (number of sign changes, should include negative values of Y) thanks Daniel Nordlund wrote: > >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >

Re: [R] Need some help

2007-10-16 Thread azzza
to *approach* a 50/50 distribution of heads and > tails in a large number of tosses, but not actually observe it. > > HTH, > > Marc Schwartz > > > On Tue, 2007-10-16 at 09:05 -0700, azzza wrote: >> >> You are right, I was a bit too vague. I am trying to simul

Re: [R] Need some help

2007-10-16 Thread azzza
ok, so suppose a coin is tossed 1000 times. Each time head occurs, we win a dollar, otherwise we lose a dollar. Let S(n) be our accumulated winnings after n tosses. For instance, if the sequence HHHTT occurs in the first five tosses, then S(5) = $1.00 wheras if the sequence H occurs, S(5) =

Re: [R] Need some help

2007-10-16 Thread azzza
Ok, so n= the toss number, and s(n) is the accumulated winnings after n tosses. Now, each time we have a heads, we win a dollar, and each time we have a tails, we lose a dollar. So, s(n) is th sign changes in 1000 tosses. In the beginning, S(0) must be 0, and S(-1) must be zero too. ok, so if on

Re: [R] Need some help

2007-10-16 Thread azzza
Thank you guyz. your codes gave me the results I was looking for. And thanks for the reference suggestion. Lastly, how do I code the frequency of heads? Daniel Lakeland wrote: > > On Tue, Oct 16, 2007 at 02:06:47PM -0400, jim holtman wrote: >> If what you are asking for is to see how many ti

Re: [R] Need some help

2007-10-16 Thread azzza
THANKYOU guyz! yes, Jim's code was right (it was similar to someone elses)I somehow missed his reply! Yes, that was exactly what i was looking for. lastly, how do i find the frequency of heads perhaps? Marc Schwartz wrote: > > On Tue, 2007-10-16 at 11:53 -0700,