Random number generator based on comments. Random number generator



Note that ideally the distribution density curve random numbers would look like shown in Fig. 22.3. That is, ideally, each interval contains the same number of points: N i = N/k , Where N total number of points, k number of intervals, i= 1, , k .

Rice. 22.3. Frequency diagram of random numbers,
generated theoretically by an ideal generator

It should be remembered that generating an arbitrary random number consists of two stages:

  • generating a normalized random number (that is, uniformly distributed from 0 to 1);
  • normalized random number conversion r i to random numbers x i, which are distributed over to the required user(arbitrary) distribution law or in the required interval.

Random number generators according to the method of obtaining numbers are divided into:

  • physical;
  • tabular;
  • algorithmic.

Physical RNG

An example of a physical RNG can be: a coin (“heads” 1, “tails” 0); dice; a drum with an arrow divided into sectors with numbers; hardware noise generator (HS), which uses a noisy thermal device, for example, a transistor (Fig. 22.422.5).

Rice. 22.4. Scheme hardware method random number generation
Rice. 22.5. Diagram of obtaining random numbers using the hardware method
Task “Generating random numbers using a coin”

Generate a random three-digit number, uniformly distributed in the range from 0 to 1, using a coin. Accuracy three decimal places.

The first way to solve the problem
Toss a coin 9 times, and if the coin lands on heads, then write down “0”; if it lands on heads, then write down “1”. So, let’s say that as a result of the experiment we received the random sequence 100110100.

Draw an interval from 0 to 1. Reading the numbers in sequence from left to right, split the interval in half and each time choose one of the parts of the next interval (if you get a 0, then the left one, if you get a 1, then the right one). Thus, you can get to any point in the interval, as accurately as you like.

So, 1 : the interval is divided in half and , the right half is selected, the interval is narrowed: . Next number 0 : the interval is divided in half and , the left half is selected, the interval is narrowed: . Next number 0 : the interval is divided in half and , the left half is selected, the interval is narrowed: . Next number 1 : the interval is divided in half and , the right half is selected, the interval is narrowed: .

According to the accuracy condition of the problem, a solution has been found: it is any number from the interval, for example, 0.625.

In principle, if we take a strict approach, then the division of intervals must be continued until the left and right boundaries of the found interval COINCIDE with an accuracy of the third decimal place. That is, from the point of view of accuracy, the generated number will no longer be distinguishable from any number from the interval in which it is located.

The second way to solve the problem
Let's split the resulting binary sequence 100110100 into triads: 100, 110, 100. After translating these binary numbers in decimal we get: 4, 6, 4. Substituting “0.” in front, we get: 0.464. This method can only produce numbers from 0.000 to 0.777 (since the maximum that can be “squeezed out” from three binary digits is 111 2 = 7 8) that is, in fact, these numbers are represented in octal system Reckoning. For translate octal numbers in decimal let's perform the representation:
0.464 8 = 4 8 1 + 6 8 2 + 4 8 3 = 0.6015625 10 = 0.602 10.
So, the required number is: 0.602.

Tabular RNG

Tabular RNGs use specially compiled tables containing verified uncorrelated, that is, in no way dependent on each other, numbers as a source of random numbers. In table Figure 22.1 shows a small fragment of such a table. By traversing the table from left to right from top to bottom, you can obtain random numbers evenly distributed from 0 to 1 with the required number of decimal places (in our example, we use three decimal places for each number). Since the numbers in the table do not depend on each other, the table can be traversed different ways, for example, from top to bottom, or from right to left, or, say, you can select numbers that are in even positions.

Table 22.1.
Random numbers. Evenly
random numbers distributed from 0 to 1
Random numbers Evenly distributed
0 to 1 random numbers
9 2 9 2 0 4 2 6 0.929
9 5 7 3 4 9 0 3 0.204
5 9 1 6 6 5 7 6 0.269
… …

Dignity this method is that it produces truly random numbers since the table contains verified uncorrelated numbers. Disadvantages of the method: storing a large number of digits requires a lot of memory; There are great difficulties in generating and checking such tables; repetitions when using a table no longer guarantee randomness number sequence, and therefore the reliability of the result.

There is a table containing 500 absolutely random verified numbers (taken from the book by I. G. Venetsky, V. I. Venetskaya “Basic mathematical and statistical concepts and formulas in economic analysis”).

Algorithmic RNG

The numbers generated by these RNGs are always pseudo-random (or quasi-random), that is, each subsequent number generated depends on the previous one:

r i + 1 = f(r i) .

Sequences made up of such numbers form loops, that is, there is necessarily a cycle that repeats infinite number once. Repeating cycles are called periods.

The advantage of these RNGs is their speed; generators require virtually no memory resources and are compact. Disadvantages: the numbers cannot be fully called random, since there is a dependence between them, as well as the presence of periods in the sequence of quasi-random numbers.

Let's consider several algorithmic methods for obtaining RNG:

  • method of median squares;
  • method of middle products;
  • stirring method;
  • linear congruent method.

Midsquare method

There is some four-digit number R 0 . This number is squared and entered into R 1 . Next from R 1 takes the middle (four middle digits) new random number and writes it into R 0 . Then the procedure is repeated (see Fig. 22.6). Note that in fact, as a random number you need to take not ghij, A 0.ghij with a zero and a decimal point added to the left. This fact is reflected as in Fig. 22.6, and in subsequent similar figures.

Rice. 22.6. Scheme of the mean squares method

Disadvantages of the method: 1) if at some iteration the number R 0 becomes equal to zero, then the generator degenerates, so the correct choice of the initial value is important R 0 ; 2) the generator will repeat the sequence through M n steps (at best), where n number digit R 0 , M base of the number system.

For example in Fig. 22.6: if the number R 0 will be presented in binary system number, then the sequence of pseudo-random numbers will be repeated in 2 4 = 16 steps. Note that the repetition of the sequence can occur earlier if the starting number is chosen poorly.

The method described above was proposed by John von Neumann and dates back to 1946. Since this method turned out to be unreliable, it was quickly abandoned.

Midproduct method

Number R 0 multiplied by R 1, from the result obtained R 2 the middle is extracted R 2 * (this is another random number) and multiplied by R 1 . All subsequent random numbers are calculated using this scheme (see Fig. 22.7).

Rice. 22.7. Scheme of the method of median products

Stirring method

The shuffle method uses operations to cyclically shift the contents of a cell left and right. The idea of ​​the method is as follows. Let the cell store the initial number R 0 . Cyclically shifting the cell contents to the left by 1/4 of the cell length, we get a new number R 0 * . In the same way, cycling the contents of the cell R 0 to the right by 1/4 of the cell length, we get the second number R 0**. Sum of numbers R 0* and R 0** gives a new random number R 1 . Further R 1 is entered in R 0, and the entire sequence of operations is repeated (see Fig. 22.8).


Rice. 22.8. Mixing method diagram

Please note that the number resulting from the summation R 0* and R 0 ** , may not fit completely in the cell R 1 . In this case, the extra digits must be discarded from the resulting number. Let us explain this in Fig. 22.8, where all cells are represented by eight binary digits. Let R 0 * = 10010001 2 = 145 10 , R 0 ** = 10100001 2 = 161 10 , Then R 0 * + R 0 ** = 100110010 2 = 306 10 . As you can see, the number 306 occupies 9 digits (in the binary number system), and the cell R 1 (same as R 0) can contain a maximum of 8 bits. Therefore, before entering the value into R 1, it is necessary to remove one “extra”, leftmost bit from the number 306, resulting in R 1 will no longer go to 306, but to 00110010 2 = 50 10 . Also note that in languages ​​such as Pascal, “trimming” of extra bits when a cell overflows is performed automatically in accordance with the specified type of the variable.

Linear congruent method

The linear congruent method is one of the simplest and most commonly used procedures currently simulating random numbers. This method uses the mod( x, y) , which returns the remainder when the first argument is divided by the second. Each subsequent random number is calculated based on the previous random number using the following formula:

r i+ 1 = mod( k · r i + b, M) .

The sequence of random numbers obtained using this formula is called linear congruent sequence. Many authors call a linear congruent sequence when b = 0 multiplicative congruent method, and when b ≠ 0 — mixed congruent method.

For a high-quality generator, it is necessary to select suitable coefficients. It is necessary that the number M was quite large, since the period cannot have more M elements. On the other hand, the division used in this method is a rather slow operation, so for a binary computer the logical choice would be M = 2 N, since in this case finding the remainder of division is reduced inside the computer to binary logical operation"AND". Choosing the largest prime number is also common M, less than 2 N: in the specialized literature it is proven that in this case the low-order digits of the resulting random number r i+ 1 behave just as randomly as the older ones, which has a positive effect on the entire sequence of random numbers as a whole. As an example, one of the Mersenne numbers, equal to 2 31 1, and thus, M= 2 31 1 .

One of the requirements for linear congruent sequences is that the period length be as long as possible. The length of the period depends on the values M , k And b. The theorem we present below allows us to determine whether it is possible to achieve the period maximum length for specific values M , k And b .

Theorem. Linear congruent sequence defined by numbers M , k , b And r 0, has a period of length M if and only if:

  • numbers b And M relatively simple;
  • k 1 times p for every prime p, which is a divisor M ;
  • k 1 is a multiple of 4, if M multiple of 4.

Finally, let's conclude with a couple of examples of using the linear congruent method to generate random numbers.

It was determined that a series of pseudo-random numbers generated based on the data from example 1 would be repeated every M/4 numbers. Number q is set arbitrarily before the start of calculations, however, it should be borne in mind that the series gives the impression of being random at large k(and therefore q). The result can be improved somewhat if b odd and k= 1 + 4 · q in this case the row will be repeated every M numbers. After a long search k the researchers settled on values ​​of 69069 and 71365.

A random number generator using the data from Example 2 will produce random, non-repeating numbers with a period of 7 million.

The multiplicative method for generating pseudorandom numbers was proposed by D. H. Lehmer in 1949.

Checking the quality of the generator

The quality of the entire system and the accuracy of the results depend on the quality of the RNG. That's why random sequence, generated by the RNG, must satisfy a number of criteria.

The checks carried out are of two types:

  • checks for uniformity of distribution;
  • tests for statistical independence.

Checks for uniformity of distribution

1) The RNG should produce close to the following values ​​of statistical parameters characteristic of a uniform random law:

2) Frequency test

A frequency test allows you to find out how many numbers fall within an interval (m r – σ r ; m r + σ r) , that is (0.5 0.2887; 0.5 + 0.2887) or, ultimately, (0.2113; 0.7887). Since 0.7887 0.2113 = 0.5774, we conclude that in a good RNG, about 57.7% of all random numbers drawn should fall into this interval (see Fig. 22.9).

Rice. 22.9. Frequency diagram of an ideal RNG
in case of checking it for frequency test

It is also necessary to take into account that the number of numbers falling into the interval (0; 0.5) should be approximately equal to the number of numbers falling into the interval (0.5; 1).

3) Chi-square test

The chi-square test (χ 2 test) is one of the most well-known statistical tests; it is the main method used in combination with other criteria. The chi-square test was proposed in 1900 by Karl Pearson. His remarkable work is considered as the foundation of modern mathematical statistics.

For our case, testing using the chi-square criterion will allow us to find out how much the real The RNG is close to the RNG benchmark, that is, whether it satisfies the uniform distribution requirement or not.

Frequency diagram reference The RNG is shown in Fig. 22.10. Since the distribution law of the reference RNG is uniform, then the (theoretical) probability p i getting numbers into i th interval (all these intervals k) is equal to p i = 1/k . And thus, in each of k intervals will hit smooth By p i · N numbers ( N total number of numbers generated).

Rice. 22.10. Frequency diagram of the reference RNG

A real RNG will produce numbers distributed (and not necessarily evenly!) across k intervals and each interval will contain n i numbers (in total n 1 + n 2 + + n k = N ). How can we determine how good the RNG being tested is and how close it is to the reference one? It is quite logical to consider the squared differences between the resulting number of numbers n i and "reference" p i · N . Let's add them up and the result is:

χ 2 exp. = ( n 1 p 1 · N) 2 + (n 2 p 2 · N) 2 + + ( n k – p k · N) 2 .

From this formula it follows that the smaller the difference in each of the terms (and therefore the less valueχ 2 exp. ), the stronger the law of distribution of random numbers generated by a real RNG tends to be uniform.

In the previous expression, each of the terms is assigned the same weight (equal to 1), which in fact may not be true; therefore, for chi-square statistics, it is necessary to normalize each i th term, dividing it by p i · N :

Finally, let’s write the resulting expression more compactly and simplify it:

We obtained the chi-square test value for experimental data.

In table 22.2 are given theoretical chi-square values ​​(χ 2 theoretical), where ν = N 1 is the number of degrees of freedom, p this is a user-specified confidence level that indicates how much the RNG should satisfy the requirements of a uniform distribution, or p — is the probability that the experimental value of χ 2 exp. will be less than the tabulated (theoretical) χ 2 theoretical. or equal to it.

Table 22.2.
Some percentage points of the χ 2 distribution
p = 1% p = 5% p = 25% p = 50% p = 75% p = 95% p = 99%
ν = 1 0.00016 0.00393 0.1015 0.4549 1.323 3.841 6.635
ν = 2 0.02010 0.1026 0.5754 1.386 2.773 5.991 9.210
ν = 3 0.1148 0.3518 1.213 2.366 4.108 7.815 11.34
ν = 4 0.2971 0.7107 1.923 3.357 5.385 9.488 13.28
ν = 5 0.5543 1.1455 2.675 4.351 6.626 11.07 15.09
ν = 6 0.8721 1.635 3.455 5.348 7.841 12.59 16.81
ν = 7 1.239 2.167 4.255 6.346 9.037 14.07 18.48
ν = 8 1.646 2.733 5.071 7.344 10.22 15.51 20.09
ν = 9 2.088 3.325 5.899 8.343 11.39 16.92 21.67
ν = 10 2.558 3.940 6.737 9.342 12.55 18.31 23.21
ν = 11 3.053 4.575 7.584 10.34 13.70 19.68 24.72
ν = 12 3.571 5.226 8.438 11.34 14.85 21.03 26.22
ν = 15 5.229 7.261 11.04 14.34 18.25 25.00 30.58
ν = 20 8.260 10.85 15.45 19.34 23.83 31.41 37.57
ν = 30 14.95 18.49 24.48 29.34 34.80 43.77 50.89
ν = 50 29.71 34.76 42.94 49.33 56.33 67.50 76.15
ν > 30 ν + sqrt(2 ν ) · x p+ 2/3 · x 2 p 2/3 + O(1/sqrt( ν ))
x p = 2.33 1.64 0.674 0.00 0.674 1.64 2.33

Considered acceptable p from 10% to 90%.

If χ 2 exp. much more than χ 2 theory. (that is p is large), then the generator does not satisfy the requirement of uniform distribution, since the observed values n i go too far from theoretical p i · N and cannot be considered random. In other words, such a large confidence interval is established that the restrictions on the numbers become very loose, the requirements on the numbers become weak. In this case, a very large absolute error will be observed.

Even D. Knuth in his book “The Art of Programming” noted that having χ 2 exp. for small ones, in general, it’s also not good, although this seems, at first glance, to be wonderful from the point of view of uniformity. Indeed, take a series of numbers 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, they are ideal from the point of view of uniformity, and χ 2 exp. will be practically zero, but you are unlikely to recognize them as random.

If χ 2 exp. much less than χ 2 theory. (that is p small), then the generator does not satisfy the requirement of a random uniform distribution, since the observed values n i too close to theoretical p i · N and cannot be considered random.

But if χ 2 exp. lies in a certain range between two values ​​of χ 2 theor. , which correspond, for example, p= 25% and p= 50%, then we can assume that the random number values ​​generated by the sensor are completely random.

In addition, it should be borne in mind that all values p i · N must be large enough, for example more than 5 (found out empirically). Only then (with a sufficiently large statistical sample) can the experimental conditions be considered satisfactory.

So, the verification procedure is as follows.

Tests for statistical independence

1) Checking for the frequency of occurrence of numbers in the sequence

Let's look at an example. The random number 0.2463389991 consists of the digits 2463389991, and the number 0.5467766618 consists of the digits 5467766618. Connecting the sequences of digits, we have: 24633899915467766618.

It is clear that the theoretical probability p i loss i The th digit (from 0 to 9) is equal to 0.1.

2) Checking the appearance of series of identical numbers

Let us denote by n L number of series of identical digits in a row of length L. Everything needs to be checked L from 1 to m, Where m this is a user-specified number: the maximum occurring number of identical digits in a series.

In the example “24633899915467766618” 2 series of length 2 (33 and 77) were found, that is n 2 = 2 and 2 series of length 3 (999 and 666), that is n 3 = 2 .

The probability of occurrence of a series of length L is equal to: p L= 9 10 L (theoretical). That is, the probability of occurrence of a series one character long is equal to: p 1 = 0.9 (theoretical). The probability of a series of two characters appearing is: p 2 = 0.09 (theoretical). The probability of a series of three characters appearing is: p 3 = 0.009 (theoretical).

For example, the probability of occurrence of a series one character long is p L= 0.9, since there can be only one symbol out of 10, and there are 9 symbols in total (zero does not count). And the probability that two identical symbols “XX” will appear in a row is 0.1 · 0.1 · 9, that is, the probability of 0.1 that the symbol “X” will appear in the first position is multiplied by the probability of 0.1 that the same symbol will appear in the second position “X” and multiplied by the number of such combinations 9.

The frequency of occurrence of series is calculated using the chi-square formula we previously discussed using the values p L .

Note: The generator can be tested multiple times, but the tests are not complete and do not guarantee that the generator produces random numbers. For example, a generator that produces the sequence 12345678912345 will be considered ideal during tests, which is obviously not entirely true.

In conclusion, we note that the third chapter of Donald E. Knuth's book The Art of Programming (Volume 2) is entirely devoted to the study of random numbers. It studies various methods generating random numbers, statistical tests of randomness, and converting uniformly distributed random numbers to other types of random variables. More than two hundred pages are devoted to the presentation of this material.

Numbers accompany us everywhere - house and apartment numbers, telephone numbers, car numbers, passport numbers, plastic cards, dates, passwords. Email. We choose some combinations of numbers ourselves, but most we get by chance. Without realizing it, we use randomly generated numbers every day. If we come up with PIN codes, then unique credit or salary card are generated by reliable systems that exclude access to passwords. Random number generators provide security in areas that require processing speed, security, and data independence.

The process of generating pseudorandom numbers is subject to certain laws and has been used for a long time, for example, in lotteries. In the recent past, drawings were carried out using lottery machines or lots. Now in many countries, the winning numbers of state lotteries are determined precisely by a set of generated random numbers.

Advantages of the method

So, a random number generator is an independent modern mechanism for randomly determining combinations of numbers. The uniqueness and perfection of this method lies in the impossibility of external intervention in the process. The generator is a set of programs built, for example, on noise diodes. The device generates a stream of random noise, the current values ​​of which are converted into numbers and form combinations.

Generating numbers provides instant results - it takes a few seconds to create a combination. If we talk about lotteries, participants can immediately find out whether the ticket number matches the winning one. This allows drawings to be held as often as participants want. But the main advantage of the method is its unpredictability and the impossibility of calculating the algorithm for selecting numbers.

How pseudorandom numbers are generated

In fact, random numbers are not random - the series starts from a given number and is generated by an algorithm. A pseudorandom number generator (PRNG or PRNG - pseudorandom number generator) is an algorithm that generates a sequence of seemingly unrelated numbers, usually subject to a uniform distribution. In computer science pseudorandom numbers used in many applications: cryptography, simulation modeling, Monte Carlo method, etc. The quality of the result depends on the properties of the PRNG.

The source of generation can be physical noise from cosmic radiation to noise in a resistor, but such devices are almost never used in network security applications. Cryptographic applications use special algorithms that generate sequences that cannot be statistically random. However, a properly chosen algorithm can produce series of numbers that pass most randomness tests. The repetition period in such sequences is greater than the working interval from which the numbers are taken.

In many modern processors contains PRNG, for example, in RdRand. As an alternative, sets of random numbers are created and published in a one-time pad (dictionary). The source of numbers in this case is limited and does not provide complete network security.

History of PRNG

A prototype of a random number generator can be considered board game Senet, common in Ancient Egypt in 3500 BC. According to the conditions, two players participated, the moves were determined by throwing four flat black and white sticks - they were a kind of PRNG of that time. The sticks were thrown at the same time, and points were counted: if one fell up with the white side, 1 point and an additional move, two white ones - two points, and so on. Maximum result The player who threw out four sticks with the black side received five points.

Nowadays, the ERNIE generator has been used for many years in the UK for lottery draws. There are two main methods for generating winning numbers: linear congruent and additive congruent. These and other methods are based on the principle of random selection and are provided by software that endlessly produces numbers whose sequence is impossible to guess.

The PRNG operates continuously, for example, in slot machines. According to US law, this required condition, which all software providers must comply with.

We have a sequence of numbers consisting of practically independent elements that obey a given distribution. As a rule, uniform distribution.

You can generate random numbers in Excel in different ways and methods. Let's consider only the best of them.

Random Number Function in Excel

  1. The RAND function returns a uniformly distributed random real number. It will be less than 1, greater than or equal to 0.
  2. The RANDBETWEEN function returns a random integer.

Let's look at their use with examples.

Sampling random numbers using RAND

This function requires no arguments (RAND()).

To generate a random real number in the range from 1 to 5, for example, use the following formula: =RAND()*(5-1)+1.

The returned random number is distributed uniformly over the interval.

Each time the worksheet is calculated or the value in any cell in the worksheet changes, a new random number is returned. If you want to save the generated population, you can replace the formula with its value.

  1. Click on the cell with a random number.
  2. In the formula bar, select the formula.
  3. Press F9. AND ENTER.

Let's check the uniformity of the distribution of random numbers from the first sample using a distribution histogram.


The range of vertical values ​​is frequency. Horizontal - “pockets”.



RANDBETWEEN function

The syntax for the RANDBETWEEN function is (lower bound; upper bound). The first argument must be less than the second. Otherwise the function will throw an error. The boundaries are assumed to be integers. Fractional part the formula is discarded.

Example of using the function:

Random numbers with precision 0.1 and 0.01:

How to make a random number generator in Excel

Let's make a random number generator that generates a value from certain range. We use a formula like: =INDEX(A1:A10,INTEGER(RAND()*10)+1).

Let's make a random number generator in the range from 0 to 100 in steps of 10.

From the list text values you need to choose 2 random ones. Using the RAND function, we compare text values ​​in the range A1:A7 with random numbers.

Let's use the INDEX function to select two random text values ​​from the original list.

To select one random value from the list, use the following formula: =INDEX(A1:A7,RANDBETWEEN(1,COUNT(A1:A7))).

Normal distribution random number generator

The RAND and RANDBETWEEN functions produce random numbers with a uniform distribution. Any value with the same probability can fall into the lower limit of the requested range and into the upper one. This results in a huge spread from the target value.

A normal distribution implies that most of the generated numbers are close to the target number. Let's adjust the RANDBETWEEN formula and create a data array with a normal distribution.

The cost of product X is 100 rubles. The entire batch produced follows a normal distribution. A random variable also follows a normal probability distribution.

Under such conditions, the average value of the range is 100 rubles. Let's generate an array and build a graph with a normal distribution with a standard deviation of 1.5 rubles.

We use the function: =NORMINV(RAND();100;1.5).

Excel calculated which values ​​were within the probability range. Since the probability of producing a product with a cost of 100 rubles is maximum, the formula shows values ​​close to 100 more often than others.

Let's move on to plotting the graph. First you need to create a table with categories. To do this, we divide the array into periods:

Based on the data obtained, we can generate a diagram with a normal distribution. The value axis is the number of variables in the interval, the category axis is periods.

If you organized, you probably encountered the difficulty of choosing a random winner. As a rule, in such situations it is used popular service Random.org. You could see the corresponding screenshots with its results when announcing the winners of competitions held on VKontakte, etc. Today we invite you to consider this project a little more detail, especially since the number generator in Random is far from its only feature.

You will find a list of all functions on the main page. To conduct drawings in Random, you can use two types of services: paid and free. They are designated as FREE and PAID services. In the first case, you simply get the result. In the second method, it is additionally possible to save all the results + the service will create an official sampling protocol.

Many readers may argue, how does a computer (machine) manage to generate random numbers? And indeed, if we take the majority, then there we're talking about O pseudorandom variables, that is, the values ​​are calculated using mathematical functions, that is, in a predictable manner. Chip of this service Random is that information is read from atmospheric noise, which allows you to get truly random numbers. Random.org was created in 1998 by a Dublin School doctor computer science and statisticians Mads Haahr. Now the project is actively used in lotteries, competitions, applications, science, etc.

Free random in the service

In most cases it is quite enough free option. The most important thing is to have a list of participants. At the same time, to draw prizes at Random.org, you can choose one of 2 trips:

  • through a random number generator;
  • using selection from lists;

Using a number generator form

Let's say on your computer you have a certain list of people taking part in a competition. On the right side of the main page you will find a widget where you will need to set parameters. In the minimum number field (Min) put one (1), in the maximum field - indicate the total number of participants. Next, click on the “Generate” button to generate the winning number.

By the way, just below on the main page there is an “Integer Generator” item, where you can generate a sequence of several random numbers in Random.org. There are a little more parameters there. This can be useful if you want to determine more than one winner in a giveaway.

Using a list generator

In the very top menu go to “Lists & more” and select the “List Randomizer” item (or find it on the main page). A new window will open in which you need to enter all your participants and click on the “Randomize” button. The program will produce a final list where the specified people will be placed randomly. The first person on the list is the winner.

In addition to sorting the list, the Random.org service will show the sampling time + your IP. You can take a screenshot of the screen and show it to participants so they can see that everyone was included in the list and the winner was chosen at the promised time.

In addition to these two Random.org generators, the project has several more interesting free features:

  • coin toss simulator;
  • random dice results;
  • lottery number generator;
  • forming a sequence of numbers (including non-repeating ones);
  • generating random strings of characters (and passwords);
  • using different random number functions;
  • obtaining arbitrary dates, geo coordinates and much more.

Paid service features

If there are large prizes involved or many people are involved, then you will be interested in paying for sampling so that the Random.org random number generator results are stored.

The price depends on the number of participants. If their number is less than five hundred people, then it will cost $4.95. If 1000 participants - $8.95. You can see more details in the screenshot:

Widgets for pages

In addition, the Random service offers additional tools. To view them, go to “web tools” in the top menu. The following options will be available here:

  1. Widgets for Your Pages. You can create widgets on this page. The system generates special code, which you place in your Internet project;
  2. API for Automated Clients. This page describes how to interface to Random.org via JSON-RPC;
  3. The HTTP API is used to display a random number in code;
  4. Banned Hosts. List of prohibited hosts.

Conclusion

So, the Random.org number generator is a great option for choosing the winner of a sweepstakes or competition. It will generate a random number based on the number of participants, plus you can choose one of the sampling methods − numeric value or a list. In addition, when using the service, no one will doubt the presence of special “deceptive” squeaks that can affect the choice of the winner. Except online versions There is also a Random generator application with different functions. In general, this is one of the iconic and really useful projects.

Today we will look at the best random number generators for the competition. Administrators of groups on social networks, as well as Instagram and bloggers, often hold competitions and various lotteries in which they give out various prizes for their subscribers and visitors on a specified date. The competition requirements often have a number of identical conditions in which the participant must perform certain actions, as well as like, subscribe to the channel, and repost material on the page. After which the blogger or administrator must select a winner randomly from those who fulfilled the conditions.

To select a winner randomly, there are special service sites that provide this opportunity. This can be done directly on your pages of social networks and blogs, without resorting to paid software or programming services. The winner can be determined randomly without knowledge of any special sciences. Most of these random number generators are free and have a simple interface, and are accessible even to less experienced users.

Many random number services work on the same principle:

  • G – rating.
  • V – weight of the factor influencing the winner’s rating.
  • S – random number.
  • With the factor weight turned on, the formula will be as follows – S + number of likes * V.
  • The operation of the generator changes slightly when adding reposts - S + likes * V + reposts * V.

The principle of calculating the generator changes in the presence of other factors; it will not be possible to take everything into account.

Fanpage Karma is one of the simple generators for determining a random winner

Very comfortable and accessible to users website http://www.fanpagekarma.com/, which provides its tools completely free of charge. There is a small drawback - the site is in English, but this can be easily dealt with using the tips that will be described below.

You only need to provide a link to the page in the yellow field with an arrow and the service will automatically do all the work to determine the winner of the competition. This is surprising, but you don't need to collect member names into large lists and provide them to the service, as some require.


Funpage Karma Random Number Generator

As you can see from the image, we get a detailed list with four categories: likes and comments, only likes, only comments and comments with the largest number likes. First of all, the random number generator for the competition is great for social Facebook networks, works with it without any additional tools. The service also provides tools for working with reports and reports completely free of charge.

RandomPicker - the most serious random number generator

RandomPicker is a paid service, but it has all the qualities to be called the best tool of its kind. If you have a large audience with the help of which a holiday competition (lottery) will be drawn and you will need to provide a report on the process of selecting a candidate for the winner upon its completion, then this service is the best suited for you, especially since it is completely Russian-language. The fly in the ointment is that the service is paid. His services cost $38 for exceeding the free limit.


Random Number Generator Random Picker

The RandomPicker generator creates a special sampling protocol and all results after determining the winner remain on the service server. This gives additional benefits for you, so you can confirm your words about a fair draw by showing your subscribers the results of the random number generator. Using this service, you can create a sampling protocol in which participants can see that they were actually included in the list, as well as other information about the drawing (number of participants, winner, etc.).

How to work with RandomPicker

  • To use the service, follow the link https://www.randompicker.com/default.aspx?Culture=ru-RU and register.
  • First, you must prepare a list of participants who will take part in the drawing. You can provide the list to the service at different types: Excel table, CSV and handwritten list.
  • If you have a small competition or other event and the list of participants is not large, then RandomPicker will select up to 100 participants for free. If there are more participants, the service costs $38. 300 thousand – maximum amount participants.
  • The service is only suitable for conducting fair drawings; no fraud is allowed. The winner is chosen only once and nothing can be changed.

Random.org – one of the first online number generators

The service was founded in 1997. It is often used as a winner determiner for competitions, although it is a simple random number generator for different tasks. In order to use this service, you must create a list of participants in advance. The service provides services for a fee and for free. IN paid version Saving the winner selection results is available.


Home page service Random.org

In order to select a winner on Random.org, you need to know the prices for services. If your list contains up to 500 people, then it will cost you around $5. 1 thousand participants costs about $9, all prices for services are available on the page https://www.random.org/draws/pricing/.

How to use the Random.org service


Woobox Pick a winner – a special service for Facebook

This is another tool for choosing a random winner in sweepstakes social network Facebook. Unfortunately, the generator is only available for this network. To determine the winner, log in to your Facebook account.


Website woobox.com
  • Now login to this website – https://woobox.com/pickawinner. You can also register using the social network itself. Facebook network by clicking on the button with the logo.
  • Next, on the site at the top, select the menu, from the drop-down list “Other Businesses” and again select the desired page from the list.
  • Select in top panel the “Posts” button, where a list of your publications on your Facebook page will open, select the publication with the competition.
  • And on the right side there is green button“Pick a Winner” - click on it.
  • You are taken to a page with a choice of 2 items – comments and likes. Select one of the criteria by which you want to select a winner and click the “Pick a Winner” button again. The system will automatically determine the winner at random. If suddenly the winner was chosen incorrectly or there are other reasons for canceling the selection result, then click the “Unpicker” button on the right side to cancel.

We have reviewed the best random number generators for online competitions. Some you can use for free, but which one you choose is up to you.







2024 gtavrl.ru.