Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: strange random behavior ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69937] Re: strange random behavior ?
  • From: dh <dh at metrohm.ch>
  • Date: Thu, 28 Sep 2006 06:14:24 -0400 (EDT)
  • References: <efdjca$je$1@smc.vnet.net>

Hi Arek,
 From what you tell, I guess that the state of the random number 
generator depends on the range of random numbers it generates. To give a 
definite answer, one would have to know how the random generator is 
implemented.
Daniel

Arkadiusz.Majka at gmail.com wrote:
> Hi,
> 
> For
> 
> SeedRandom[7]
> Table[Random[Integer, {1, 6}], {5}]
> Table[Random[Integer, {1, 3}], {5}]
> 
> I get
> 
> Out[32]=
> {2,1,6,2,6}
> 
> Out[33]=
> {2,1,3,1,3}
> 
> When i repeat I obviosly get the same (magic of seedrandom)
> 
> SeedRandom[7]
> Table[Random[Integer, {1, 6}], {5}]
> Table[Random[Integer, {1, 3}], {5}]
> 
> 
> Out[32]=
> {2,1,6,2,6}
> 
> Out[33]=
> {2,1,3,1,3}
> 
> Bu when I change the range of random numbers in generation of the first
> list , say 1->2
> 
> SeedRandom[7]
> Table[Random[Integer, {2, 6}], {5}]
> Table[Random[Integer, {1, 3}], {5}]
> 
> I get
> 
> Out[35]=
> {3,2,3,6,6}
> 
> Out[36]=
> {2,2,3,1,3}
> 
> Since Seed is still the same (7), why second list is changed? (Out[36]
> does not equal to Out[33])
> 
> This behavior does not take place when we do not deal with tables but
> with single elements.
> 
> Arek
> 


  • Prev by Date: Re: linear second order homogeneous differential equation recursions
  • Next by Date: RE: conversion to InputForm without spaces
  • Previous by thread: strange random behavior ?
  • Next by thread: Re: strange random behavior ?