1 /* Copyright (C) 1999, 2000, 2001, 2003, 2005, 2006, 2009, 2010,
2 * 2012, 2013, 2014 Free Software Foundation, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 3 of
7 * the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 /* Original Author: Mikael Djurfeldt <djurfeldt@nada.kth.se> */
28 #include "libguile/_scm.h"
34 #include <sys/types.h>
37 #include "libguile/smob.h"
38 #include "libguile/numbers.h"
39 #include "libguile/feature.h"
40 #include "libguile/strings.h"
41 #include "libguile/arrays.h"
42 #include "libguile/srfi-4.h"
43 #include "libguile/vectors.h"
44 #include "libguile/generalized-vectors.h"
46 #include "libguile/validate.h"
47 #include "libguile/random.h"
51 * A plugin interface for RNGs
53 * Using this interface, it is possible for the application to tell
54 * libguile to use a different RNG. This is desirable if it is
55 * necessary to use the same RNG everywhere in the application in
56 * order to prevent interference, if the application uses RNG
57 * hardware, or if the application has special demands on the RNG.
59 * Look in random.h and how the default generator is "plugged in" in
63 scm_t_rng scm_the_rng
;
69 * This is the MWC (Multiply With Carry) random number generator
70 * described by George Marsaglia at the Department of Statistics and
71 * Supercomputer Computations Research Institute, The Florida State
72 * University (http://stat.fsu.edu/~geo).
74 * It uses 64 bits, has a period of 4578426017172946943 (4.6e18), and
75 * passes all tests in the DIEHARD test suite
76 * (http://stat.fsu.edu/~geo/diehard.html)
79 typedef struct scm_t_i_rstate
{
86 #define A 2131995753UL
89 #define M_PI 3.14159265359
93 scm_i_uniform32 (scm_t_rstate
*state
)
95 scm_t_i_rstate
*istate
= (scm_t_i_rstate
*) state
;
96 scm_t_uint64 x
= (scm_t_uint64
) A
* istate
->w
+ istate
->c
;
97 scm_t_uint32 w
= x
& 0xffffffffUL
;
104 scm_i_init_rstate (scm_t_rstate
*state
, const char *seed
, int n
)
106 scm_t_i_rstate
*istate
= (scm_t_i_rstate
*) state
;
110 for (i
= 0; i
< n
; ++i
)
114 w
+= seed
[i
] << (8 * m
);
116 c
+= seed
[i
] << (8 * (m
- 4));
118 if ((w
== 0 && c
== 0) || (w
== -1 && c
== A
- 1))
124 static scm_t_rstate
*
125 scm_i_copy_rstate (scm_t_rstate
*state
)
127 scm_t_rstate
*new_state
;
129 new_state
= scm_gc_malloc_pointerless (state
->rng
->rstate_size
,
131 return memcpy (new_state
, state
, state
->rng
->rstate_size
);
134 SCM_SYMBOL(scm_i_rstate_tag
, "multiply-with-carry");
137 scm_i_rstate_from_datum (scm_t_rstate
*state
, SCM value
)
138 #define FUNC_NAME "scm_i_rstate_from_datum"
140 scm_t_i_rstate
*istate
= (scm_t_i_rstate
*) state
;
144 SCM_VALIDATE_LIST_COPYLEN (SCM_ARG1
, value
, length
);
145 SCM_ASSERT (length
== 3, value
, SCM_ARG1
, FUNC_NAME
);
146 SCM_ASSERT (scm_is_eq (SCM_CAR (value
), scm_i_rstate_tag
),
147 value
, SCM_ARG1
, FUNC_NAME
);
148 SCM_VALIDATE_UINT_COPY (SCM_ARG1
, SCM_CADR (value
), w
);
149 SCM_VALIDATE_UINT_COPY (SCM_ARG1
, SCM_CADDR (value
), c
);
157 scm_i_rstate_to_datum (scm_t_rstate
*state
)
159 scm_t_i_rstate
*istate
= (scm_t_i_rstate
*) state
;
160 return scm_list_3 (scm_i_rstate_tag
,
161 scm_from_uint32 (istate
->w
),
162 scm_from_uint32 (istate
->c
));
167 * Random number library functions
171 scm_c_make_rstate (const char *seed
, int n
)
175 state
= scm_gc_malloc_pointerless (scm_the_rng
.rstate_size
,
177 state
->rng
= &scm_the_rng
;
178 state
->normal_next
= 0.0;
179 state
->rng
->init_rstate (state
, seed
, n
);
184 scm_c_rstate_from_datum (SCM datum
)
188 state
= scm_gc_malloc_pointerless (scm_the_rng
.rstate_size
,
190 state
->rng
= &scm_the_rng
;
191 state
->normal_next
= 0.0;
192 state
->rng
->from_datum (state
, datum
);
197 scm_c_default_rstate ()
198 #define FUNC_NAME "scm_c_default_rstate"
200 SCM state
= SCM_VARIABLE_REF (scm_var_random_state
);
201 if (!SCM_RSTATEP (state
))
202 SCM_MISC_ERROR ("*random-state* contains bogus random state", SCM_EOL
);
203 return SCM_RSTATE (state
);
209 scm_c_uniform01 (scm_t_rstate
*state
)
211 double x
= (double) state
->rng
->random_bits (state
) / (double) 0xffffffffUL
;
212 return ((x
+ (double) state
->rng
->random_bits (state
))
213 / (double) 0xffffffffUL
);
217 scm_c_normal01 (scm_t_rstate
*state
)
219 if (state
->normal_next
!= 0.0)
221 double ret
= state
->normal_next
;
223 state
->normal_next
= 0.0;
231 r
= sqrt (-2.0 * log (scm_c_uniform01 (state
)));
232 a
= 2.0 * M_PI
* scm_c_uniform01 (state
);
235 state
->normal_next
= r
* cos (a
);
242 scm_c_exp1 (scm_t_rstate
*state
)
244 return - log (scm_c_uniform01 (state
));
247 unsigned char scm_masktab
[256];
249 static inline scm_t_uint32
250 scm_i_mask32 (scm_t_uint32 m
)
255 ? scm_masktab
[m
>> 8] << 8 | 0xff
257 ? scm_masktab
[m
>> 16] << 16 | 0xffff
258 : ((scm_t_uint32
) scm_masktab
[m
>> 24]) << 24 | 0xffffff)));
262 scm_c_random (scm_t_rstate
*state
, scm_t_uint32 m
)
264 scm_t_uint32 r
, mask
= scm_i_mask32 (m
);
265 while ((r
= state
->rng
->random_bits (state
) & mask
) >= m
);
270 scm_c_random64 (scm_t_rstate
*state
, scm_t_uint64 m
)
275 if (m
<= SCM_T_UINT32_MAX
)
276 return scm_c_random (state
, (scm_t_uint32
) m
);
278 mask
= scm_i_mask32 (m
>> 32);
279 while ((r
= ((scm_t_uint64
) (state
->rng
->random_bits (state
) & mask
) << 32)
280 | state
->rng
->random_bits (state
)) >= m
)
286 SCM scm_c_random_bignum (scm_t_rstate *state, SCM m)
288 Takes a random state (source of random bits) and a bignum m.
289 Returns a bignum b, 0 <= b < m.
291 It does this by allocating a bignum b with as many base 65536 digits
292 as m, filling b with random bits (in 32 bit chunks) up to the most
293 significant 1 in m, and, finally checking if the resultant b is too
294 large (>= m). If too large, we simply repeat the process again. (It
295 is important to throw away all generated random bits if b >= m,
296 otherwise we'll end up with a distorted distribution.)
301 scm_c_random_bignum (scm_t_rstate
*state
, SCM m
)
303 SCM result
= scm_i_mkbig ();
304 const size_t m_bits
= mpz_sizeinbase (SCM_I_BIG_MPZ (m
), 2);
305 /* how many bits would only partially fill the last scm_t_uint32? */
306 const size_t end_bits
= m_bits
% (sizeof (scm_t_uint32
) * SCM_CHAR_BIT
);
307 scm_t_uint32
*random_chunks
= NULL
;
308 const scm_t_uint32 num_full_chunks
=
309 m_bits
/ (sizeof (scm_t_uint32
) * SCM_CHAR_BIT
);
310 const scm_t_uint32 num_chunks
= num_full_chunks
+ ((end_bits
) ? 1 : 0);
312 /* we know the result will be this big */
313 mpz_realloc2 (SCM_I_BIG_MPZ (result
), m_bits
);
316 (scm_t_uint32
*) scm_gc_calloc (num_chunks
* sizeof (scm_t_uint32
),
317 "random bignum chunks");
321 scm_t_uint32
*current_chunk
= random_chunks
+ (num_chunks
- 1);
322 scm_t_uint32 chunks_left
= num_chunks
;
324 mpz_set_ui (SCM_I_BIG_MPZ (result
), 0);
328 /* generate a mask with ones in the end_bits position, i.e. if
329 end_bits is 3, then we'd have a mask of ...0000000111 */
330 const scm_t_uint32 rndbits
= state
->rng
->random_bits (state
);
331 int rshift
= (sizeof (scm_t_uint32
) * SCM_CHAR_BIT
) - end_bits
;
332 scm_t_uint32 mask
= ((scm_t_uint32
)-1) >> rshift
;
333 scm_t_uint32 highest_bits
= rndbits
& mask
;
334 *current_chunk
-- = highest_bits
;
340 /* now fill in the remaining scm_t_uint32 sized chunks */
341 *current_chunk
-- = state
->rng
->random_bits (state
);
344 mpz_import (SCM_I_BIG_MPZ (result
),
347 sizeof (scm_t_uint32
),
351 /* if result >= m, regenerate it (it is important to regenerate
352 all bits in order not to get a distorted distribution) */
353 } while (mpz_cmp (SCM_I_BIG_MPZ (result
), SCM_I_BIG_MPZ (m
)) >= 0);
354 scm_gc_free (random_chunks
,
355 num_chunks
* sizeof (scm_t_uint32
),
356 "random bignum chunks");
357 return scm_i_normbig (result
);
361 * Scheme level representation of random states.
364 scm_t_bits scm_tc16_rstate
;
367 make_rstate (scm_t_rstate
*state
)
369 SCM_RETURN_NEWSMOB (scm_tc16_rstate
, state
);
374 * Scheme level interface.
377 SCM_GLOBAL_VARIABLE_INIT (scm_var_random_state
, "*random-state*", scm_seed_to_random_state (scm_from_locale_string ("URL:http://stat.fsu.edu/~geo/diehard.html")));
379 SCM_DEFINE (scm_random
, "random", 1, 1, 0,
381 "Return a number in [0, N).\n"
383 "Accepts a positive integer or real n and returns a\n"
384 "number of the same type between zero (inclusive) and\n"
385 "N (exclusive). The values returned have a uniform\n"
388 "The optional argument @var{state} must be of the type produced\n"
389 "by @code{seed->random-state}. It defaults to the value of the\n"
390 "variable @var{*random-state*}. This object is used to maintain\n"
391 "the state of the pseudo-random-number generator and is altered\n"
392 "as a side effect of the random operation.")
393 #define FUNC_NAME s_scm_random
395 if (SCM_UNBNDP (state
))
396 state
= SCM_VARIABLE_REF (scm_var_random_state
);
397 SCM_VALIDATE_RSTATE (2, state
);
400 scm_t_bits m
= (scm_t_bits
) SCM_I_INUM (n
);
401 SCM_ASSERT_RANGE (1, n
, SCM_I_INUM (n
) > 0);
402 #if SCM_SIZEOF_UINTPTR_T <= 4
403 return scm_from_uint32 (scm_c_random (SCM_RSTATE (state
),
405 #elif SCM_SIZEOF_UINTPTR_T <= 8
406 return scm_from_uint64 (scm_c_random64 (SCM_RSTATE (state
),
409 #error "Cannot deal with this platform's scm_t_bits size"
412 SCM_VALIDATE_NIM (1, n
);
414 return scm_from_double (SCM_REAL_VALUE (n
)
415 * scm_c_uniform01 (SCM_RSTATE (state
)));
418 SCM_WRONG_TYPE_ARG (1, n
);
419 return scm_c_random_bignum (SCM_RSTATE (state
), n
);
423 SCM_DEFINE (scm_copy_random_state
, "copy-random-state", 0, 1, 0,
425 "Return a copy of the random state @var{state}.")
426 #define FUNC_NAME s_scm_copy_random_state
428 if (SCM_UNBNDP (state
))
429 state
= SCM_VARIABLE_REF (scm_var_random_state
);
430 SCM_VALIDATE_RSTATE (1, state
);
431 return make_rstate (SCM_RSTATE (state
)->rng
->copy_rstate (SCM_RSTATE (state
)));
435 SCM_DEFINE (scm_seed_to_random_state
, "seed->random-state", 1, 0, 0,
437 "Return a new random state using @var{seed}.")
438 #define FUNC_NAME s_scm_seed_to_random_state
441 if (SCM_NUMBERP (seed
))
442 seed
= scm_number_to_string (seed
, SCM_UNDEFINED
);
443 SCM_VALIDATE_STRING (1, seed
);
444 res
= make_rstate (scm_c_make_rstate (scm_i_string_chars (seed
),
445 scm_i_string_length (seed
)));
446 scm_remember_upto_here_1 (seed
);
452 SCM_DEFINE (scm_datum_to_random_state
, "datum->random-state", 1, 0, 0,
454 "Return a new random state using @var{datum}, which should have\n"
455 "been obtained from @code{random-state->datum}.")
456 #define FUNC_NAME s_scm_datum_to_random_state
458 return make_rstate (scm_c_rstate_from_datum (datum
));
462 SCM_DEFINE (scm_random_state_to_datum
, "random-state->datum", 1, 0, 0,
464 "Return a datum representation of @var{state} that may be\n"
465 "written out and read back with the Scheme reader.")
466 #define FUNC_NAME s_scm_random_state_to_datum
468 SCM_VALIDATE_RSTATE (1, state
);
469 return SCM_RSTATE (state
)->rng
->to_datum (SCM_RSTATE (state
));
473 SCM_DEFINE (scm_random_uniform
, "random:uniform", 0, 1, 0,
475 "Return a uniformly distributed inexact real random number in\n"
477 #define FUNC_NAME s_scm_random_uniform
479 if (SCM_UNBNDP (state
))
480 state
= SCM_VARIABLE_REF (scm_var_random_state
);
481 SCM_VALIDATE_RSTATE (1, state
);
482 return scm_from_double (scm_c_uniform01 (SCM_RSTATE (state
)));
486 SCM_DEFINE (scm_random_normal
, "random:normal", 0, 1, 0,
488 "Return an inexact real in a normal distribution. The\n"
489 "distribution used has mean 0 and standard deviation 1. For a\n"
490 "normal distribution with mean m and standard deviation d use\n"
491 "@code{(+ m (* d (random:normal)))}.")
492 #define FUNC_NAME s_scm_random_normal
494 if (SCM_UNBNDP (state
))
495 state
= SCM_VARIABLE_REF (scm_var_random_state
);
496 SCM_VALIDATE_RSTATE (1, state
);
497 return scm_from_double (scm_c_normal01 (SCM_RSTATE (state
)));
502 vector_scale_x (SCM v
, double c
)
505 if (scm_is_vector (v
))
507 n
= SCM_SIMPLE_VECTOR_LENGTH (v
);
509 SCM_REAL_VALUE (SCM_SIMPLE_VECTOR_REF (v
, n
)) *= c
;
513 /* must be a f64vector. */
514 scm_t_array_handle handle
;
519 elts
= scm_f64vector_writable_elements (v
, &handle
, &len
, &inc
);
521 for (i
= 0; i
< len
; i
++, elts
+= inc
)
524 scm_array_handle_release (&handle
);
529 vector_sum_squares (SCM v
)
533 if (scm_is_vector (v
))
535 n
= SCM_SIMPLE_VECTOR_LENGTH (v
);
538 x
= SCM_REAL_VALUE (SCM_SIMPLE_VECTOR_REF (v
, n
));
544 /* must be a f64vector. */
545 scm_t_array_handle handle
;
550 elts
= scm_f64vector_elements (v
, &handle
, &len
, &inc
);
552 for (i
= 0; i
< len
; i
++, elts
+= inc
)
558 scm_array_handle_release (&handle
);
563 /* For the uniform distribution on the solid sphere, note that in
564 * this distribution the length r of the vector has cumulative
565 * distribution r^n; i.e., u=r^n is uniform [0,1], so r can be
566 * generated as r=u^(1/n).
568 SCM_DEFINE (scm_random_solid_sphere_x
, "random:solid-sphere!", 1, 1, 0,
570 "Fills @var{vect} with inexact real random numbers the sum of\n"
571 "whose squares is less than 1.0. Thinking of @var{vect} as\n"
572 "coordinates in space of dimension @var{n} @math{=}\n"
573 "@code{(vector-length @var{vect})}, the coordinates are\n"
574 "uniformly distributed within the unit @var{n}-sphere.")
575 #define FUNC_NAME s_scm_random_solid_sphere_x
577 if (SCM_UNBNDP (state
))
578 state
= SCM_VARIABLE_REF (scm_var_random_state
);
579 SCM_VALIDATE_RSTATE (2, state
);
580 scm_random_normal_vector_x (v
, state
);
582 pow (scm_c_uniform01 (SCM_RSTATE (state
)),
583 1.0 / scm_c_array_length (v
))
584 / sqrt (vector_sum_squares (v
)));
585 return SCM_UNSPECIFIED
;
589 SCM_DEFINE (scm_random_hollow_sphere_x
, "random:hollow-sphere!", 1, 1, 0,
591 "Fills vect with inexact real random numbers\n"
592 "the sum of whose squares is equal to 1.0.\n"
593 "Thinking of vect as coordinates in space of\n"
594 "dimension n = (vector-length vect), the coordinates\n"
595 "are uniformly distributed over the surface of the\n"
597 #define FUNC_NAME s_scm_random_hollow_sphere_x
599 if (SCM_UNBNDP (state
))
600 state
= SCM_VARIABLE_REF (scm_var_random_state
);
601 SCM_VALIDATE_RSTATE (2, state
);
602 scm_random_normal_vector_x (v
, state
);
603 vector_scale_x (v
, 1 / sqrt (vector_sum_squares (v
)));
604 return SCM_UNSPECIFIED
;
609 SCM_DEFINE (scm_random_normal_vector_x
, "random:normal-vector!", 1, 1, 0,
611 "Fills vect with inexact real random numbers that are\n"
612 "independent and standard normally distributed\n"
613 "(i.e., with mean 0 and variance 1).")
614 #define FUNC_NAME s_scm_random_normal_vector_x
617 scm_t_array_handle handle
;
618 scm_t_array_dim
*dim
;
620 if (SCM_UNBNDP (state
))
621 state
= SCM_VARIABLE_REF (scm_var_random_state
);
622 SCM_VALIDATE_RSTATE (2, state
);
624 scm_generalized_vector_get_handle (v
, &handle
);
625 dim
= scm_array_handle_dims (&handle
);
627 if (handle
.element_type
== SCM_ARRAY_ELEMENT_TYPE_SCM
)
629 SCM
*elts
= scm_array_handle_writable_elements (&handle
);
630 for (i
= dim
->lbnd
; i
<= dim
->ubnd
; i
++, elts
+= dim
->inc
)
631 *elts
= scm_from_double (scm_c_normal01 (SCM_RSTATE (state
)));
635 /* must be a f64vector. */
636 double *elts
= scm_array_handle_f64_writable_elements (&handle
);
637 for (i
= dim
->lbnd
; i
<= dim
->ubnd
; i
++, elts
+= dim
->inc
)
638 *elts
= scm_c_normal01 (SCM_RSTATE (state
));
641 scm_array_handle_release (&handle
);
643 return SCM_UNSPECIFIED
;
647 SCM_DEFINE (scm_random_exp
, "random:exp", 0, 1, 0,
649 "Return an inexact real in an exponential distribution with mean\n"
650 "1. For an exponential distribution with mean u use (* u\n"
652 #define FUNC_NAME s_scm_random_exp
654 if (SCM_UNBNDP (state
))
655 state
= SCM_VARIABLE_REF (scm_var_random_state
);
656 SCM_VALIDATE_RSTATE (1, state
);
657 return scm_from_double (scm_c_exp1 (SCM_RSTATE (state
)));
661 /* Return a new random-state seeded from the time, date, process ID, an
662 address from a freshly allocated heap cell, an address from the local
663 stack frame, and a high-resolution timer if available. This is only
664 to be used as a last resort, when no better source of entropy is
667 random_state_of_last_resort (void)
670 SCM time_of_day
= scm_gettimeofday ();
671 SCM sources
= scm_list_n
672 (scm_from_unsigned_integer (SCM_UNPACK (time_of_day
)), /* heap addr */
673 /* Avoid scm_getpid, since it depends on HAVE_POSIX. */
674 scm_from_unsigned_integer (getpid ()), /* process ID */
675 scm_get_internal_real_time (), /* high-resolution process timer */
676 scm_from_unsigned_integer ((scm_t_bits
) &time_of_day
), /* stack addr */
677 scm_car (time_of_day
), /* seconds since midnight 1970-01-01 UTC */
678 scm_cdr (time_of_day
), /* microsecond component of the above clock */
681 /* Concatenate the sources bitwise to form the seed */
682 SCM seed
= SCM_INUM0
;
683 while (scm_is_pair (sources
))
685 seed
= scm_logxor (seed
, scm_ash (scm_car (sources
),
686 scm_integer_length (seed
)));
687 sources
= scm_cdr (sources
);
690 /* FIXME The following code belongs in `scm_seed_to_random_state',
691 and here we should simply do:
693 return scm_seed_to_random_state (seed);
695 Unfortunately, `scm_seed_to_random_state' only preserves around 32
696 bits of entropy from the provided seed. I don't know if it's okay
697 to fix that in 2.0, so for now we have this workaround. */
701 len
= scm_to_int (scm_ceiling_quotient (scm_integer_length (seed
),
703 buf
= (unsigned char *) malloc (len
);
704 for (i
= len
-1; i
>= 0; --i
)
706 buf
[i
] = scm_to_int (scm_logand (seed
, SCM_I_MAKINUM (255)));
707 seed
= scm_ash (seed
, SCM_I_MAKINUM (-8));
709 state
= make_rstate (scm_c_make_rstate ((char *) buf
, len
));
715 /* Attempt to fill buffer with random bytes from /dev/urandom.
716 Return 1 if successful, else return 0. */
718 read_dev_urandom (unsigned char *buf
, size_t len
)
721 FILE *f
= fopen ("/dev/urandom", "r");
724 res
= fread(buf
, 1, len
, f
);
730 /* Fill a buffer with random bytes seeded from a platform-specific
731 source of entropy. /dev/urandom is used if available. Note that
732 this function provides no guarantees about the amount of entropy
733 present in the returned bytes. */
735 scm_i_random_bytes_from_platform (unsigned char *buf
, size_t len
)
737 if (read_dev_urandom (buf
, len
))
739 else /* FIXME: support other platform sources */
741 /* When all else fails, use this (rather weak) fallback */
742 SCM random_state
= random_state_of_last_resort ();
744 for (i
= len
-1; i
>= 0; --i
)
745 buf
[i
] = scm_to_int (scm_random (SCM_I_MAKINUM (256), random_state
));
749 SCM_DEFINE (scm_random_state_from_platform
, "random-state-from-platform", 0, 0, 0,
751 "Construct a new random state seeded from a platform-specific\n\
752 source of entropy, appropriate for use in non-security-critical applications.")
753 #define FUNC_NAME s_scm_random_state_from_platform
755 unsigned char buf
[32];
756 if (read_dev_urandom (buf
, sizeof(buf
)))
757 return make_rstate (scm_c_make_rstate ((char *) buf
, sizeof(buf
)));
759 return random_state_of_last_resort ();
767 /* plug in default RNG */
770 sizeof (scm_t_i_rstate
),
774 scm_i_rstate_from_datum
,
775 scm_i_rstate_to_datum
779 scm_tc16_rstate
= scm_make_smob_type ("random-state", 0);
781 for (m
= 1; m
<= 0x100; m
<<= 1)
782 for (i
= m
>> 1; i
< m
; ++i
)
783 scm_masktab
[i
] = m
- 1;
785 #include "libguile/random.x"
787 scm_add_feature ("random");