Hello Friends, A little doubt, need some clarification. Within a module I have 2 variables and I assign a range to them ........ ....... int a; int b; a = $urandom_range(1,0); b = $urandom_range(1,0);
.... .............
Now the question is for a particular seed will a & b always have the same values? (My assumption is yes,they will always be having same value for specific seed)
No, I don't think they will have the same value... they may have change to get same value but not necessarily try to put the above code in a loop and see
> Hello Friends, > A little doubt, need some clarification. > Within a module I have 2 variables and I assign a range to them > ........ > ....... > int a; > int b; > a = $urandom_range(1,0); > b = $urandom_range(1,0);
> .... > .............
> Now the question is for a particular seed will a & b always have the > same values? > (My assumption is yes,they will always be having same value for > specific seed)
> No, I don't think they will have the same value... they may have change to > get same value but not necessarily > try to put the above code in a loop and see
> Essam
> On 9/25/07, mssajwan <mssaj...@gmail.com> wrote:
> > Hello Friends, > > A little doubt, need some clarification. > > Within a module I have 2 variables and I assign a range to them > > ........ > > ....... > > int a; > > int b; > > a = $urandom_range(1,0); > > b = $urandom_range(1,0);
> > .... > > .............
> > Now the question is for a particular seed will a & b always have the > > same values? > > (My assumption is yes,they will always be having same value for > > specific seed)
> > Need your thoughts on it. > > Thanks > > Manmohan
a and b will have different values. As b gets the next random number. But if u put a loop and store all the values of a or b in a file u will find u r getting same values in all the runs. For example, if in the first run values of a are: 10001100 and b are: 1110011. In the second run also u'll get values of a as: 10001100 and those of b are: 1110011. If u delete the line b = $urandom_range(1,0); u'll get 11011 etc. The values of a and b are combined provided u dont change the seed value.
> No, I don't think they will have the same value... they may have change to > get same value but not necessarily > try to put the above code in a loop and see
> Essam
> On 9/25/07, mssajwan wrote:
> > Hello Friends, > > A little doubt, need some clarification. > > Within a module I have 2 variables and I assign a range to them > > ........ > > ....... > > int a; > > int b; > > a = $urandom_range(1,0); > > b = $urandom_range(1,0);
> > .... > > .............
> > Now the question is for a particular seed will a & b always have the > > same values? > > (My assumption is yes,they will always be having same value for > > specific seed)
> > Need your thoughts on it. > > Thanks > > Manmohan
********************************************************************** Dr. Mala Mitra, email : mala_2001...@yahoo.com, mala_2001...@hotmail.com Phone : 9845056179 (Mobile). *********************************************************************
--------------------------------- Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.
> Hello Friends, > A little doubt, need some clarification. > Within a module I have 2 variables and I assign a range to them > ........ > ....... > int a; > int b; > a = $urandom_range(1,0); > b = $urandom_range(1,0);
> .... > .............
> Now the question is for a particular seed will a & b always have the > same values? > (My assumption is yes,they will always be having same value for > specific seed)