Help / Phrases / 10. F. Random Numbers

From J Wiki
Jump to navigation Jump to search


>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Phrases


10F. Random Numbers


d0=: {.@[ + ?@(] $ -@(-/@[)) Shape y array of random numbers in x
d1=: ?@# x numbers from i.y with replacement
d2=: ? x numbers from i.y without replacement
m3=: 9!:1@<.@(+/ .^&2@(6!:0@])) Randomizing random number seed
m4=: (>:@? % 2147483647&[) @ $ & 2147483646 Random numbers between 0 and 1
m5=: {~ ?~@# Random shuffle of y




>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Phrases