This file is indexed.

/usr/share/slsh/help/randfuns.hlp is in slsh 2.3.0-2ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
rand_exp

 SYNOPSIS
  Generate exponentially distributed random numbers

 USAGE
  X = rand_exp([Rand_Type g,] beta [,num])

 DESCRIPTION
 This function generates random numbers that are distributed according
 to an exponential distribution with parameter beta > 0.  The
 distribution's probability density is given by

   P(x,beta) = (1/beta) exp(-x/beta)


 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 NOTES
 The exponential generator is commonly used to simulate waiting times
 between events.

 SEE ALSO
  rand_new, rand_uniform

--------------------------------------------------------------

rand_int

 SYNOPSIS
  Generate random integers

 USAGE
  X = rand_int ([Rand_Type g,] imin, imax [,num])

 DESCRIPTION
 This function may be used to generate a random integer `X' such
 that `imin <= X <= imax'.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_uniform, rand, rand_new

--------------------------------------------------------------

rand_tdist

 SYNOPSIS
  Generate random numbers from the Student t distribution

 USAGE
  X = rand_tdist ([Rand_Type g,] nu [,num])

 DESCRIPTION
 This function generates random numbers that are distributed according
 to the Student-t distribution with nu>0.0 degrees of freedom.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_uniform, rand_new, rand_chisq, rand_fdist

--------------------------------------------------------------

rand_fdist

 SYNOPSIS
  Generate random numbers from the F distribution

 USAGE
  X = rand_fdist ([Rand_Type g,], nu1, nu2 [,num])

 DESCRIPTION
 This function generates random numbers that are distributed according
 to the F-distribution, which is the ratio of two chi-squared
 distributed variates whose degrees of freedom are given by
 `nu1' (numerator) and `nu2' (denominator).

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_uniform, rand_chisq, rand_tdist, rand_gauss, rand_new

--------------------------------------------------------------

rand_chisq

 SYNOPSIS
  Generate Chi-Square distributed random numbers

 USAGE
  X = rand_fdist ([Rand_Type g,] nu, [,num])

 DESCRIPTION
 This function generates random numbers that are distributed according
 to the Chi-squared distribution with `nu > 0' degrees of freedom.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_uniform, rand_fdist, rand_tdist, rand_gauss, rand_new

--------------------------------------------------------------

rand_flat

 SYNOPSIS
  Generate uniformly distributed random numbers

 USAGE
  X = rand_fdist ([Rand_Type g,] xmin, xmax [,num])

 DESCRIPTION
 This function generates random double-precision floating point
 numbers that are uniformly distributed in the range
 `xmin<=X<xmax'.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_uniform, rand_uniform_pos, rand_int, rand, rand_new

--------------------------------------------------------------

rand_gamma

 SYNOPSIS
  Generate Gamma distributed random numbers

 USAGE
  X = rand_gamma ([Rand_Type g,], k, theta [,num])

 DESCRIPTION
 This function returns random deviates that are Gamma-distributed
 according to the probability density

   P(x; k,theta) = x^(k-1)*exp(-x/theta)/(theta^k * Gamma(k))

 where `k,theta>0.0'.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_beta, rand_uniform, rand_binomial, rand_new

--------------------------------------------------------------

rand_binomial

 SYNOPSIS
  Generate random numbers from the binomial distribution

 USAGE
  X = rand_binomial ([Rand_Type g,], p, n, [,num])

 DESCRIPTION
  This function generates binomial distributed random numbers
  according to the probability density

   P(x;p,n) = n!/(k!*(n-k)!) * p^k * (1-p)^(n-k)

  where `n' is a non-negative integer and `0<=p<=1'.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_gamma, rand_poisson, rand_uniform, rand_new

--------------------------------------------------------------

rand_poisson

 SYNOPSIS
  Generate Poisson distributed random numbers

 USAGE
  k = rand_poisson ([Rand_Type g,] mu [,num])

 DESCRIPTION
 This function generates random unsigned integers that are
 poisson-distributed according to the probability distribution

   P(k;mu) = mu^k/k! * exp(-mu)

  where `mu>0.0'.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_gauss, rand_uniform, rand_binomial, rand_new

--------------------------------------------------------------

rand_geometric

 SYNOPSIS
  Generate random numbers from the geometric distribution

 USAGE
  k = rand_geometric ([Rand_Type g,] p [,num])

 DESCRIPTION
 This function generates random numbers that are distributed
 according to a geometric distribution with a probability density

   P(k; p) = p*(1-p)^(k-1)

 where `0<=p<=1'

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_poisson, rand_exp, rand_gauss, rand_uniform, rand_new

--------------------------------------------------------------

rand_cauchy

 SYNOPSIS
  Generate random numbers from the Cauchy distribution

 USAGE
  X = rand_cauchy ([Rand_Type g,] gamma [,num])

 DESCRIPTION
 This function generates random numbers that are distributed
 according to a cauchy-distribution with a probability density

   P(x; gamma) = 1/(PI*gamma)/(1+(x/gamma)^2)

 where `gamma>=0.0'.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_gauss, rand_poisson, rand_exp, rand_new

--------------------------------------------------------------

rand_beta

 SYNOPSIS
  Generate random numbers from the beta distribution

 USAGE
  X = rand_fdist ([Rand_Type g,] a, b [,num])

 DESCRIPTION
 This function generates random numbers that are distributed
 according to a Beta-distribution with a probability density

   P(x; a,b) = x^(a-1)*(1-x)^(b-1)/B(a,b)

 where `a, b > 0'.

 SEE ALSO
  rand_gamma, rand_binomial, rand_chisq

--------------------------------------------------------------

rand_gauss

 SYNOPSIS
  Generate gaussian-distributed random numbers

 USAGE
  X = rand_gauss ([Rand_Type g,] sigma [,num])

 DESCRIPTION
 This function generates gaussian random numbers with the specified
 sigma and mean of 0 according to the probability density

   P(x; sigma) = 1/sqrt(2*PI*sigma^2) * exp(-0.5*x^2/sigma^2)


 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 NOTES
  This implementation utilizes the Box-Muller algorithm.

 SEE ALSO
  rand_uniform, rand_poisson, rand_chisq, rand_gauss, rand_new

--------------------------------------------------------------

rand

 SYNOPSIS
  Generate random integers numbers

 USAGE
  X = rand ([Rand_Type g,] [,num])

 DESCRIPTION
 This function generates unsigned 32 bit randomly distributed
 integers on the closed interval 0<=X<=0xFFFFFFFFUL.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_new, rand_int, rand_uniform, rand_flat

--------------------------------------------------------------

rand_uniform_pos

 SYNOPSIS
  Generate uniform positive random numbers

 USAGE
  X = rand_uniform_pos ([Rand_Type] [num])

 DESCRIPTION
  This function generates uniformly distributed random numbers in open
  interval `0<X<1'.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_uniform, rand_new

--------------------------------------------------------------

rand_uniform

 SYNOPSIS
  Generate uniform random numbers

 USAGE
  X = rand_uniform ([Rand_Type g] [num])

 DESCRIPTION
  This function generates uniformly distributed double precision
  numbers on the semi-closed interval `0<=r<1'.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 SEE ALSO
  rand_uniform_pos, rand_int, rand_flat, rand_new

--------------------------------------------------------------

srand

 SYNOPSIS
  Seed the random number generator

 USAGE
  srand ([Rand_Type g,] Array_Type seeds)

 DESCRIPTION
 This function may be used to seed an instance of a rand number
 generator using the values of an array of an unsigned long integers.
 If a generator (created by `rand_new') is specified as the first
 argument, then is will be seeded; otherwise, the seeds will
 get applied to the default generator.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.
 The `num' parameter indicates that `num' random values are to
 be generated and returned as an array.

 EXAMPLE

    gen = rand_new ();
    srand (gen, [_time(), _pid(), 0xFF80743]);


 SEE ALSO
  rand_new, rand, rand_uniform

--------------------------------------------------------------

rand_new

 SYNOPSIS
  Instantiate a new random number generator

 USAGE
  Rand_Type rand_new ([array-of-seeds])

 DESCRIPTION
 This function creates a new instance of the basic random number
 generator.  An optional array of 32 bit unsigned integers may be used
 to seed the generator.  By default, the generator is seeding using
 the current time and process id.  The `srand' function may also
 be used to seed the generator.  The generator created by the
 `rand_new' function may be passed as the first argument to most
 of the other functions in the module to indicate that this instance
 should be used as the basic generator.

 EXAMPLE
 The following example shows how to create an array of 512 uniform
 random numbers derived from the default instance of the basic
 generator:

   x = rand_uniform (512);

 A specific instance of the generator may be created using the
 `rand_new' function and used by `rand_uniform' as follows:

   g = rand_new ([0x1234, 0x5678912, 0xEFAB1234]);
   x = rand_uniform (g, 512);


 NOTES
 The generator is a hybrid one that sums the results of 3 separate
 generators: George Marsaglia's MZRAN13 generator, a multiply with
 carry generator (also by Marsaglia), and a product generator.  The
 combined generator has a 192 bit state and a period exceeding 10^46.

 The resulting random sequences were tested using version 2.24.4 of
 the dieharder random number testing program.  The tests showed that
 this generator performed better than the famous Marsenne
 Twister (`mt19937') both in terms of randomness and speed.  More
 information about the test results may be found at
 `http://www.jedsoft.org/slang/modules/rand.html'.

 The `mt19937' generator is separately available via the GSL
 module.

 SEE ALSO
  srand, rand_int, rand_uniform

--------------------------------------------------------------

rand_sample

 SYNOPSIS
  Randomly sample from one or more arrays

 USAGE
  (b1 [,b2,...]) = rand_sample ([Rand_Type g,] a1 [,a2,...], num);

 DESCRIPTION
 This function may be used to randomly sample `num' elements from
 one or more arrays (`a1,...').  The arrays must be consistent in
 the sense that they must have the same leading dimension, which is
 the one to be sampled.

 The optional first argument may be used to specify a different
 instance of a random number generator.  Otherwise, the default
 generator will be used.

 EXAMPLE
 Suppose A is a 1-d array with 20 elements, and B is a 2d array with
 dimensions [20,30].  Then

   (A1, B1) = rand_sample (A, B, 5);

 will produce a 1d array A1 with 5 elements and a 2d array B1 with
 dimensions [5,30].

 NOTES
 The indices used to sample the arrays are created using the first
 `num' elements of a random permutation of the integers
 `[0:dim0-1]' where `dim0' is the size of the leading
 dimension.  The same set of indices are used for all the arrays.
 Hence any correspondence between `a0[i,..]' and `a1[i,...'
 will be preserved in the samples.

 SEE ALSO
  rand_permutation, rand_new

--------------------------------------------------------------

rand_permutation

 SYNOPSIS
  Generate a random permutation of integers

 USAGE
  p = rand_permutation ([Rand_Type g,] Int_Type n)

 DESCRIPTION
  This function may be used to generate a random permutation of the
  sequence of integers `0,1,..,n-1'.

 The optional parameter `g' may be used to
 specify the underlying random number generator.  See the
 documentation for the `rand_new' function for more information.

 SEE ALSO
  rand_sample

--------------------------------------------------------------