V
V
Vadim Stepanenko2018-02-20 18:54:17
Algorithms
Vadim Stepanenko, 2018-02-20 18:54:17

Winner Selection Algorithm?

Hello!
Please tell me, suddenly someone knows the algorithm for choosing the winner, corresponding to the following points:
1. Users "donate" rubles. 1 ruble - 1 ticket. The first user threw 5.000r, the second 50r. Accordingly, there will be 5050 tickets in total. And the winning one is selected - 1-5000 - wine user 1, 5001-5050 - wine user two. That is, this is not a roulette, where there are 3 colors, how many users bet
2 should be taken into account. Before the game, some kind of key should be generated so that after the game, users can check whether the game was fair according to some algorithms.
3. It is impossible to predict / decrypt the key outcome

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Eremin, 2018-02-20
@EreminD

1-5000 - VIN user 1,
5001-5050 - VIN user two.

So far, what I have managed to understand is that user1 has 5000/5050 chances, and user2 has 50/5050 chances.
Why not just randomly take a number in the range from 1 to 5050?

X
xmoonlight, 2018-02-20
@xmoonlight

1. Percentage of the total.
2. Input and output data must be available to all participants m1=md5(num1.SECSALT), m2=md5(num2.SECSALT), m3=md5(num3.SECSALT), etc.
Then we form HASH: HASH=md5(m1.m2.m3.SECSALT) after voting, we reveal num1, num2, num3 and SECSALT to all voters and formulas for verification.
3. One-way hash functions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question