Andy Posted September 26, 2018 Share Posted September 26, 2018 Hello I'm new here. I'm on the demo and doing fine but for the life of me I can't figure out what the n integer does after :seed? I know seed fixes a random function so it is repeatable but what does that number do? I tried changing it in Tutorial 5 but I can't make sense of it! Thanks Andy Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted September 27, 2018 Share Posted September 27, 2018 Hi Andy, the seed is just a number you choose. Because it stop the random engine in a state, it allow to recover some values you generate randomly. Very useful for example for creating a random theme and call it back after or for further variations. What the seed number is to initialise the random engine in a state attached to this number. SB. Quote Link to comment Share on other sites More sharing options...
Andy Posted September 27, 2018 Author Share Posted September 27, 2018 Hi Stephane Ah I think I see, so it is an arbitary number that is an identifier....is that correct? Thank you Andy Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted September 27, 2018 Share Posted September 27, 2018 Yes, something like that. Best SB. Quote Link to comment Share on other sites More sharing options...
Andy Posted September 27, 2018 Author Share Posted September 27, 2018 Quote Link to comment Share on other sites More sharing options...
opmo Posted September 28, 2018 Share Posted September 28, 2018 The seed number is the random state number. Quote Link to comment Share on other sites More sharing options...
torstenanders Posted October 13, 2018 Share Posted October 13, 2018 > the random state number. Seed values are only relevant for functions that do some random operations. In layman's terms, think of rolling a dice. You want to ensure that the dice always rolls the same number, and for that purpose, you put some glue on one of its sides. The seed number effectively controls on which side of your dice you put the glue. It is not the same as the number that is the result, but controls which number will be the result. Now think of having some more complex algorithm than just a dice, where you have a similar mechanism to control what the output should be and that way fixing the output to a static value that can be re-computed multiple times. opmo 1 Quote Link to comment Share on other sites More sharing options...
Andy Posted October 13, 2018 Author Share Posted October 13, 2018 Great explanation Torsten thanks....and the value of the number attached to the "glued side" is arbitrary? It's an index to the glued side but as such can be any chosen value? Quote Link to comment Share on other sites More sharing options...
torstenanders Posted October 13, 2018 Share Posted October 13, 2018 > the value of the number attached to the "glued side" is arbitrary No, it is not, it depends on the implementation of the random generator used. However, this is far from being intuitive to understand, and beyond that, for several functions, the seed controls multiple random generators, where basically the seed for their seed is then computed randomly. So, for practical uses, you can consider the choice of seed values random. Just for background, in a simple random number generator, the seed can be used in an integer division where the resulting random value is the modulus (see https://en.wikipedia.org/wiki/Lehmer_random_number_generator). So, there is no indexing... Best, Torsten Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.