self centering random walk within defined range

2009-02-28 Thread rob
hi, i am finding something couter intuative about randomness and search for a solution. i have a bit of code that randomly selects a number from an array and then adds it to the previous number. I have two positive numbers and their negitives qw(1 2 -1 -2) i expected the below code to hover

Re: self centering random walk within defined range

2009-02-28 Thread Rob Dixon
r...@goto10.org wrote: > hi, > > i am finding something couter intuative about randomness and search for a > solution. > > i have a bit of code that randomly selects a number from an array and then > adds > it to the previous number. I have two positive numbers and their negitives > qw(1 2

Re: self centering random walk within defined range

2009-02-28 Thread rob
Rob Dixon said : > r...@goto10.org wrote: > > hi, > > > > i am finding something couter intuative about randomness and search for a > > solution. > > > > i have a bit of code that randomly selects a number from an array and then > > adds > > it to the previous number. I have two positive numb

Re: self centering random walk within defined range

2009-02-28 Thread Chas. Owens
On Sat, Feb 28, 2009 at 12:22, wrote: > Rob Dixon said : >> r...@goto10.org wrote: >> > hi, >> > >> > i am finding something couter intuative about randomness and search for a >> > solution. >> > >> > i have a bit of code that randomly selects a number from an array and then >> > adds >> > it to

Re: self centering random walk within defined range

2009-02-28 Thread Chas. Owens
On Sat, Feb 28, 2009 at 14:56, Chas. Owens wrote: snip > This seems close to what you want, but it needs work to make it take > steps larger than 1: snip Here is another version that takes steps larger than one: #!/usr/bin/perl use strict; use warnings; # 12345678901 # * # 5/11 chance of

Re: self centering random walk within defined range

2009-03-01 Thread Rob Canning
Chas. Owens said : > On Sat, Feb 28, 2009 at 14:56, Chas. Owens wrote: > snip > > This seems close to what you want, but it needs work to make it take > > steps larger than 1: > snip > > Here is another version that takes steps larger than one: > > #!/usr/bin/perl > > use strict; > use warnings