Hi Forum,
I was trying a few variation of $dist_exponential function in edalink
There are 2 scenarios of the actual argument to seed
(a) It’s a run-time variable i.e manually seeded
(b) Using $urandom()
In (a) I observe that even on random seeds a tool gives same output. Further I notice that the output is same across all tools. I believe this is due to the initial seed being the same i.e 1
In (b) as $urandom gets a different seed based on master seed ( due to tool based random seed switch ), the results are different across tools ( refer thread )
As per LRM
For each system function, the seed argument is an inout argument;
that is, a value is passed to the function, and a different value is returned
In (a) value of 1 is repeated as the inout seed argument ( -417135238 ) remains the same during 2nd occurrence
Seeking inputs on the following
(Q1) Why does seed change after 2nd occurrence of value of 1 ? Shouldn’t it keep on repeating value as 1 due to seed being same ?
(Q2) What is the range of values returned by $dist_exponential( seed , mean ) ?
(Q3) Should the actual argument to seed always be $urandom ? Is there any alternative ?
Q1: It’s hard to provide an answer without seeing the code. The values returned by these functions have been predefined since the 1980s and are included in the appendix. I believe that the LRM doesn’t mention that if no seed is provided, a shared global seed is used instead.
Q2: The range of values returned by $dist_exponential is any signed integer. However, due to its exponential nature, you’ll be hard-pressed to see any integer at the minimum negative or maximum positive integer values.
You can initialize a local seed variable using either $urandom or object.randomize(). Then, use that variable to seed $dist_exponential.
a) This means that value returned can be negative as well
Q4) Based on (a) would the max positive value be ((2**32) - 1 ) or ((2**31) - 1 ) ?
I was referring to LRM 20.14.2 which doesn’t explicitly mention these points. It says
Each of these functions returns a pseudo-random number whose characteristics are described by the function name.
In other words, $dist_uniform returns random numbers uniformly distributed in the interval specified by its arguments.
When I see a graph of distribution exponential it’s always in 1st quadrant ( which I interpret as min value being 0 )
Also over multiple random seeds and across all 4 EDA tools, I observe only positive values when passing +define+URAND