The program works as designed and intended.  If you want to add to NuVoc, pray do.

Henry Rich

On 7/19/2020 10:36 AM, Hauke Rehr wrote:
Sure we want repeated results.
But do we want the same results for all of
   ?. 2^11
   ?. 2^12
   ?. 2^13
and the same results for all of
   ?. 2^14
   ?. 2^15
   ?. 2^16
   ?. 2^17
   ?. 2^18
   ?. 2^19
?
If you don’t know about this and try to
work with powers of two, switching to ?.
someday since you want reproducible results,
you might end up with very bad results
even though you tested the statistical
properties when you were still dealing
with ?

I understand much depends on this.
But I don’t understand this can be
expected behaviour.

In my opinion, it either needs to be
documented or fixed.



Am 19.07.20 um 16:29 schrieb Henry Rich:
The whole purpose of ?. is to give repeated results.  Every invocation of ?. plays the same canned sequence of the underlying RNG.

    ?. 20 # 35
34 31 13 31 5 23 31 11 6 29 3 17 8 11 9 27 32 5 34 10
    ?. 20 # 7
6 3 6 3 5 2 3 4 6 1 3 3 1 4 2 6 4 5 6 3

Notice anything?

    7 | ?. 20 # 35
6 3 6 3 5 2 3 4 6 1 3 3 1 4 2 6 4 5 6 3

If you want random numbers, use ? .  If you want repeatability, use ?. .  If you want a bit of both, create a verb that cycles through a million numbers dealt initially by ?. .

At this point there is so much test code that depends on the exact behavior of ?. that we consider it untouchable.

Henry Rich

On 7/19/2020 8:33 AM, Hauke Rehr wrote:
I have an issue using ?. .
   ?. 2^y
gives the same result for several y in a row.
If I do
   ?. 2^y+i.x
for the same successive values,
the rng will iterate and values differ.

I understand the difference between the two
invocations and think it’s okay for them to
give different results; but I think it should
not be the case that the first way gives so
many repeated results.

Try
   ?. 2^y
for all y in 11+i.3 or 14+i.6 successively,
for example. They all give 1826 and 10018,
respectively. I think that’s bad.

In the documentation I did not find a statement
about these repetitions nor about the difference
between using ?. successively and using it on a list.






--
This email has been checked for viruses by AVG.
https://www.avg.com

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to