# თარგი:Rand

The documentation of this template is transcluded from Template:Rand/doc.თარგი:Template documentation

This template generates a pseudo-random integer between 0 and count-1.

Usage:
• {{Rand|count|seed|prime}}
• All parameters are optional and have default values. They must be integers.
• The default count is 100 (so by default, this template generates values between 0 and 99) and must be non-zero.
• The default seed is 7 and can be set to any other integer value (used to generate distinct values on the same page).
• The default prime is 67 and should be a prime number above 17 (used to generate distinct values on the same page).
Examples generating numbers between 0 and 999:
• {{Rand|1000}} = 507
• {{Rand|1000|7|67}} = 507 (same as above)
• {{Rand|1000|7|61}} = 331 (this and others should all be different)
• {{Rand|1000|6}} = 744
• {{Rand|1000|5}} = 981
• {{Rand|1000|4}} = 218
• {{Rand|1000|3}} = 455
• {{Rand|1000|2}} = 692
• {{Rand|1000|1}} = 929
• {{Rand|1000|0}} = 166
• {{Rand|1000|1|17}} = 716 (varying the prime number)
• {{Rand|1000|1|19}} = 510
• {{Rand|1000|1|23}} = 330
• {{Rand|1000|1|29}} = 120
• {{Rand|1000|1|31}} = 394
• {{Rand|1000|1|37}} = 496
• {{Rand|1000|1|41}} = 284
• {{Rand|1000|1|43}} = 390
• {{Rand|1000|1|47}} = 186
• {{Rand|1000|1|51}} = 974
• {{Rand|1000|1|53}} = 320
• {{Rand|1000|1|59}} = 950
• {{Rand|1000|1|61}} = 464
• {{Rand|1000|1|67}} = 166
• {{Rand|1000|1|71}} = 754
• {{Rand|1000|1|73}} = 980
• {{Rand|1000|1|79}} = 170
Note:
• Varying seed linearily generates numbers that generates a linear sequence on the same page, with equal cyclic steps;
• Varying prime (provided that they are odd prime numbers) generates pseudo-random that have independant random distribution.
• Note that when count is even (such as 100 by default, or 1000 in the examples above), the generated numbers (on the same page) are all odd or all even when you are varying the seed or prime, unless half of the calls use an even seed and the others used an odd seed. However, later invokations will still alternate odd and even numbers on output (this problem only occurs on the same page where multiple random numbers are invoked).
• On the same page, multiple invokations of this template with the same parameters will generate the same ouput value, so it is possible to create multiple links related to the same article.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7230971,"math_prob":0.99672776,"size":2399,"snap":"2020-45-2020-50","text_gpt3_token_len":778,"char_repetition_ratio":0.23507307,"word_repetition_ratio":0.030690538,"special_character_ratio":0.40683618,"punctuation_ratio":0.05936073,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95450956,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-29T17:49:37Z\",\"WARC-Record-ID\":\"<urn:uuid:a63b897f-f68d-46de-8d45-151bdee21fb6>\",\"Content-Length\":\"58149\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b1ae055f-6281-47bb-9f97-2f341fa9e427>\",\"WARC-Concurrent-To\":\"<urn:uuid:b29dea1a-20f0-4ad7-ab9a-30cc8eeac80b>\",\"WARC-IP-Address\":\"208.80.154.224\",\"WARC-Target-URI\":\"https://ka.wikipedia.org/wiki/%E1%83%97%E1%83%90%E1%83%A0%E1%83%92%E1%83%98:Rand\",\"WARC-Payload-Digest\":\"sha1:QYDSL5SCTDPW2NACRNU5XDLPE7S5RVV7\",\"WARC-Block-Digest\":\"sha1:WYAPXVPQV5VALNJVVV6LW2TC67FVYJIB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107904834.82_warc_CC-MAIN-20201029154446-20201029184446-00034.warc.gz\"}"}