BloodyRookie


January 31, 2014, 10:30:48 AM 

Alice rolls 1000face die. Bob rolls 1000face die. Alice wins if she gets 1 or 2 (her balance is 100k), Bob wins if he gets 1 (his balance is 50k).
How many times Alice will win if she rolls the die 1000 times? How many times Bob will win if he rolls the die 1000 times?
Could anyone answer the questions above?
Your premise means that if Alice gets 1 and Bob gets 1, both win. Is that really what you want it to be?

Nothing Else Matters NEM: NALICELGU3IVY4DPJKHYLSSVYFFWYS5QPLYEZDJJ NXT: 11095639652683007953



BloodyRookie


January 31, 2014, 10:33:18 AM 

We'll come to it step by step. The 1st step requires u to answer the questions. btw, this is childish. I'm ready to answer any of your questions related to my original post. This question is not until you explain how. I don't blame u, coz there is no a good explanation how forging works, but I'm quite tired to explain why people r wrong with their models. In ur case u r wrong coz u analyze an impossible situation when there r only 2 forging accounts in the system. Models doesn't work in extremum conditions. So you agree that in the case of only 2 forgers, their analysis is ok?

Nothing Else Matters NEM: NALICELGU3IVY4DPJKHYLSSVYFFWYS5QPLYEZDJJ NXT: 11095639652683007953



ComefromBeyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie


January 31, 2014, 10:34:09 AM 

So you agree that in the case of only 2 forgers, their analysis is ok?
No.




ComefromBeyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie


January 31, 2014, 10:36:31 AM 

Your premise means that if Alice gets 1 and Bob gets 1, both win. Is that really what you want it to be?
Yes, if both get 1 then both win but one of the blocks will be orphaned.




martismartis
Legendary
Offline
Activity: 1162
Merit: 1005


January 31, 2014, 11:34:45 AM 

Your premise means that if Alice gets 1 and Bob gets 1, both win. Is that really what you want it to be?
Yes, if both get 1 then both win but one of the blocks will be orphaned. Which one and why?




ComefromBeyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie


January 31, 2014, 11:50:40 AM 

Your premise means that if Alice gets 1 and Bob gets 1, both win. Is that really what you want it to be?
Yes, if both get 1 then both win but one of the blocks will be orphaned. Which one and why? Depends on network topology. Blockchain can't have more than 1 block at a particular height.




jettico
Member
Offline
Activity: 80
Merit: 10


January 31, 2014, 12:13:13 PM 

I don't blame u, coz there is no a good explanation how forging works, but I'm quite tired to explain why people r wrong with their models. In ur case u r wrong coz u analyze an impossible situation when there r only 2 forging accounts in the system. Models doesn't work in extremum conditions.
At leeeast a sensible argument! Let's see! from random import random from operator import itemgetter
NBLOCKS = 100000 N = 100 W = [100000] + [1000] * N z = [0.] * len(W) wins = [0] * len(W)
for x in xrange(NBLOCKS): for i in xrange(len(W)): z[i] = random()/W[i] [position, value] = min(enumerate(z), key=itemgetter(1)) wins[position] += 1
print float(wins[0])/sum(wins[1:]), float(wins[0])/(sum(wins[1:])/N) 1.72101439417 172.340599455 (instead of 1 and 100) Not THAT bad, but still!




ComefromBeyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie


January 31, 2014, 12:17:25 PM 

Not THAT bad, but still!
Still far from the reality.




ejhuff
Newbie
Offline
Activity: 41
Merit: 0


January 31, 2014, 01:13:10 PM Last edit: January 31, 2014, 01:36:25 PM by ejhuff 

Alice rolls 1000face die. Bob rolls 1000face die. Alice wins if she gets 1 or 2 (her balance is 100k), Bob wins if he gets 1 (his balance is 50k).
How many times Alice will win if she rolls the die 1000 times? How many times Bob will win if he rolls the die 1000 times?
Could anyone answer the questions above?
Here are some simulation results: seed = 0x000004d2 = 1234 RAND_MAX = 0x7fffffff = 2147483647 RETRY = 0x7ffffd78 = 2147483000 In 1000000 total trials of 1000 throws each, Alice won (2 chances in 1000 per throw) as follows: Alice won 0 times in 135332 of the trials. Alice won 1 times in 270858 of the trials. Alice won 2 times in 271239 of the trials. Alice won 3 times in 180359 of the trials. Alice won 4 times in 90048 of the trials. Alice won 5 times in 35744 of the trials. Alice won 6 times in 11955 of the trials. Alice won 7 times in 3388 of the trials. Alice won 8 times in 858 of the trials. Alice won 9 times in 179 of the trials. Alice won 10 times in 35 of the trials. Alice won 11 times in 4 of the trials. Alice won 12 times in 1 of the trials. In 1000000 total trials of 1000 throws each, Bob won (1 chance in 1000 per throw) as follows: Bob won 0 times in 368738 of the trials. Bob won 1 times in 368080 of the trials. Bob won 2 times in 183462 of the trials. Bob won 3 times in 60983 of the trials. Bob won 4 times in 15109 of the trials. Bob won 5 times in 3063 of the trials. Bob won 6 times in 484 of the trials. Bob won 7 times in 76 of the trials. Bob won 8 times in 5 of the trials. In 1000000 total trials of 1000 throws each, They both won (2 chances in 1000000 per throw) as follows: Both won 0 times in 998026 of the trials. Both won 1 times in 1973 of the trials. Both won 2 times in 1 of the trials. Number of random numbers drawn = 0x0077359654 estimated period = 0x07fffffff0
Another try with different random numbers seed = 0x00003039 = 12345 RAND_MAX = 0x7fffffff = 2147483647 RETRY = 0x7ffffd78 = 2147483000 In 1000000 total trials of 1000 throws each, Alice won (2 chances in 1000 per throw) as follows: Alice won 0 times in 135982 of the trials. Alice won 1 times in 270421 of the trials. Alice won 2 times in 270428 of the trials. Alice won 3 times in 180820 of the trials. Alice won 4 times in 90182 of the trials. Alice won 5 times in 35843 of the trials. Alice won 6 times in 11828 of the trials. Alice won 7 times in 3425 of the trials. Alice won 8 times in 839 of the trials. Alice won 9 times in 195 of the trials. Alice won 10 times in 32 of the trials. Alice won 11 times in 4 of the trials. Alice won 12 times in 1 of the trials. In 1000000 total trials of 1000 throws each, Bob won (1 chances in 1000 per throw) as follows: Bob won 0 times in 368609 of the trials. Bob won 1 times in 368350 of the trials. Bob won 2 times in 183326 of the trials. Bob won 3 times in 61018 of the trials. Bob won 4 times in 15096 of the trials. Bob won 5 times in 3052 of the trials. Bob won 6 times in 467 of the trials. Bob won 7 times in 71 of the trials. Bob won 8 times in 11 of the trials. In 1000000 total trials of 1000 throws each, They both won (2 chances in 1000000 per throw) as follows: Both won 0 times in 998103 of the trials. Both won 1 times in 1892 of the trials. Both won 2 times in 5 of the trials. Number of random numbers drawn = 0x007735962c estimated period = 0x07fffffff0
Both win when Bob rolls 1 and Alice rolls 1 or 2, which is twice in the 1000000 possible rolls of two 1000 face dice. Throwing 2 dice 1000 times each (1 trial), we should never see both win. Throwing 2 dice 1000 x 1000000 times (1000000 trials), we should see both win about 2000 times, which we do.




aljazstraser
Newbie
Offline
Activity: 107
Merit: 0


January 31, 2014, 03:17:41 PM 

I am new with NXT.. can someone explain me in few words, why i should start dealing with "next generation coins". I saw videos, but still i need to hear it from more experienced users.
Thanks in advance




liyi3c
Newbie
Offline
Activity: 26
Merit: 0


January 31, 2014, 04:23:44 PM Last edit: January 31, 2014, 04:47:42 PM by liyi3c 

Now imagine that you throw a dice with numbers from 1 to 6 and your opponent throws a semidice with three possible values from 1 to 3.
this analogy doesn't match forging properly, as the second dice(13) can't be treated uniform distribution. Instead, the p(1) = 1/6, p(2) = 1/6, p(3) = 2/3 which should also includes the implicitly removed p(4),p(5),p(6) in your analogy. in this way, the ratio should be 2 rather than 3. edit: if 100k divided into 100*1k, 100*p(1k gen Block) will be slightly lower than p(100k gen Block) as generation mutual exclusion




jettico
Member
Offline
Activity: 80
Merit: 10


January 31, 2014, 05:06:11 PM 

Still far from the reality.
The reality is that your algorithm is wrong.




Cryddit
Legendary
Offline
Activity: 924
Merit: 1130


January 31, 2014, 05:25:40 PM 

Ok. Keep ignoring. Discussion is over, we'll continue it after I get the answers.
Dude, there is no way someone capable of writing code is also capable of the kind of category error that would make them think there are relevant questions to ask. The entire purpose of code is to specify a process so exactly that there is no room for questions. And you're looking at a thread in which two different people have posted code. There is no possible question about what the code means that the code itself does not completely and unambiguously answer. The algorithm you described either is, or is not, accurately implemented by the code presented. There are no questions to ask here. You understand the algorithm because it's your algorithm in the first place. If the code doesn't implement it correctly, then it's because there is an error in the code or because the description you gave isn't correct, and only you can explain the error or provide the correction. There are no questions you can ask someone else to address that, because that knowledge is yours alone. It does not belong to anyone else whom you could ask a question. If the code does match, then the effect it demonstrates is an effect of the algorithm. And if that's true, then only you as the developer can decide whether to do anything about it and if so what. Again, no questions you can ask anyone else are relevant, because it's your decision not anyone else's. So I only have one question; why are you pretending to have a problem understanding this?




ComefromBeyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie


January 31, 2014, 05:27:19 PM 

Still far from the reality.
The reality is that your algorithm is wrong. I disagree.




starik69
Legendary
Offline
Activity: 1367
Merit: 1000


January 31, 2014, 05:33:16 PM 

There are no questions to ask here.
Even if those two don't understand math?




ComefromBeyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie


January 31, 2014, 05:33:47 PM 

And you're looking at a thread in which two different people have posted code.
Both the people made the same error. So I only have one question; why are you pretending to have a problem understanding this?
Already answered why ur model is incorrect. Sorry, I'm not going to waste my time on every guy who does a logical error.




ComefromBeyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie


January 31, 2014, 05:36:52 PM 

@ All:
If u r going to bother me with the same issue again and again, please, make sure that blockchain data proves ur math. Till now the data proves that I'm right.




Cryddit
Legendary
Offline
Activity: 924
Merit: 1130


January 31, 2014, 06:13:44 PM 

For what it's worth, comefrombeyond has a point when he says that the situation is exaggerated by an artificial situation with just two accounts. I decided to try a broader simulation, and see what the effects are. So, I set this up with 26 accounts, each having a different balance from 1000 to 26000, and bumped it up to a million trials to get consistent results despite statistical noise having a greater impact on a more complex situation. Here's the code: #include <stdlib.h> #include <stdio.h>
// takes a balance; returns an interval to block forging time. double rollem(double balance){ double roll = 0.0; while (roll == 0.0) roll = ((double) rand())/RAND_MAX; return 1000 * roll / balance; }
main(){ double balances[26], times[26]; double min, totalmoney = 0.0; int wins[26]; int winner, count, trial, TRIALS = 1000000;
for (count = 0; count < 26; count++){ balances[count] = (count+1) * 1000; totalmoney += balances[count]; wins[count] = 0; }
for (trial = 0; trial < TRIALS; trial++){ for (count = 0; count < 26; count++){ times[count] = rollem(balances[count]); } min = times[0]; winner = 0; for (count = 1; count < 26; count++) if (min > times[count]){ min = times[count]; winner = count; } wins[winner]++; } for (count = 0; count < 26; count++){ printf("%c got %f%% of the wins with %f%% of the money.\n", count+'A', 100*(double)wins[count]/TRIALS, 100*(double)balances[count]/totalmoney); } }
The effect is still present, in that the accounts with larger than median balances get more than their share of blocks, but it's considerably less important given the number of accounts and range of account values under consideration. I deliberately let the smaller account win the block in every tie, just to ensure that the bias demonstrated was not due to a systematic error going the other direction. In this broader simulation, people do not get three times the number of blocks relative to someone with half their balance; Instead they get only a tiny fraction more than double. (note, these pairs are AB, BD, CF, DH, EJ, and so on). Here are the results: A got 0.269800% of the wins with 0.284900% of the money. B got 0.545100% of the wins with 0.569801% of the money. C got 0.832000% of the wins with 0.854701% of the money. D got 1.076900% of the wins with 1.139601% of the money. E got 1.364900% of the wins with 1.424501% of the money. F got 1.627700% of the wins with 1.709402% of the money. G got 1.925300% of the wins with 1.994302% of the money. H got 2.226500% of the wins with 2.279202% of the money. I got 2.473800% of the wins with 2.564103% of the money. J got 2.812900% of the wins with 2.849003% of the money. K got 3.108000% of the wins with 3.133903% of the money. L got 3.333500% of the wins with 3.418803% of the money. M got 3.667000% of the wins with 3.703704% of the money. N got 3.954400% of the wins with 3.988604% of the money. O got 4.229700% of the wins with 4.273504% of the money. P got 4.554900% of the wins with 4.558405% of the money. Q got 4.813100% of the wins with 4.843305% of the money. R got 5.146400% of the wins with 5.128205% of the money. S got 5.400300% of the wins with 5.413105% of the money. T got 5.720200% of the wins with 5.698006% of the money. U got 6.039900% of the wins with 5.982906% of the money. V got 6.336200% of the wins with 6.267806% of the money. W got 6.610200% of the wins with 6.552707% of the money. X got 7.018400% of the wins with 6.837607% of the money. Y got 7.296000% of the wins with 7.122507% of the money. Z got 7.616900% of the wins with 7.407407% of the money.




opticalcarrier


January 31, 2014, 06:19:08 PM 

For what it's worth, comefrombeyond has a point when he says that the situation is exaggerated by an artificial situation with just two accounts. I decided to try a broader simulation, and see what the effects are. So, I set this up with 26 accounts, each having a different balance from 1000 to 26000, and bumped it up to a million trials to get consistent results despite statistical noise having a greater impact on a more complex situation. Here's the code: #include <stdlib.h> #include <stdio.h>
// takes a balance; returns an interval to block forging time. double rollem(double balance){ double roll = 0.0; while (roll == 0.0) roll = ((double) rand())/RAND_MAX; return 1000 * roll / balance; }
main(){ double balances[26], times[26]; double min, totalmoney = 0.0; int wins[26]; int winner, count, trial, TRIALS = 1000000;
for (count = 0; count < 26; count++){ balances[count] = (count+1) * 1000; totalmoney += balances[count]; wins[count] = 0; }
for (trial = 0; trial < TRIALS; trial++){ for (count = 0; count < 26; count++){ times[count] = rollem(balances[count]); } min = times[0]; winner = 0; for (count = 1; count < 26; count++) if (min > times[count]){ min = times[count]; winner = count; } wins[winner]++; } for (count = 0; count < 26; count++){ printf("%c got %f%% of the wins with %f%% of the money.\n", count+'A', 100*(double)wins[count]/TRIALS, 100*(double)balances[count]/totalmoney); } }
The effect is still present, in that the accounts with larger than median balances get more than their share of blocks, but it's considerably less important given the number of accounts and range of account values under consideration. In particular, people do not get three times the number of blocks relative to someone with half their balance; Instead they get only a tiny fraction more than double. (note, these pairs are AB, BD, CF, DH, EJ, and so on). Here are the results: A got 0.269800% of the wins with 0.284900% of the money. B got 0.545100% of the wins with 0.569801% of the money. C got 0.832000% of the wins with 0.854701% of the money. D got 1.076900% of the wins with 1.139601% of the money. E got 1.364900% of the wins with 1.424501% of the money. F got 1.627700% of the wins with 1.709402% of the money. G got 1.925300% of the wins with 1.994302% of the money. H got 2.226500% of the wins with 2.279202% of the money. I got 2.473800% of the wins with 2.564103% of the money. J got 2.812900% of the wins with 2.849003% of the money. K got 3.108000% of the wins with 3.133903% of the money. L got 3.333500% of the wins with 3.418803% of the money. M got 3.667000% of the wins with 3.703704% of the money. N got 3.954400% of the wins with 3.988604% of the money. O got 4.229700% of the wins with 4.273504% of the money. P got 4.554900% of the wins with 4.558405% of the money. Q got 4.813100% of the wins with 4.843305% of the money. R got 5.146400% of the wins with 5.128205% of the money. S got 5.400300% of the wins with 5.413105% of the money. T got 5.720200% of the wins with 5.698006% of the money. U got 6.039900% of the wins with 5.982906% of the money. V got 6.336200% of the wins with 6.267806% of the money. W got 6.610200% of the wins with 6.552707% of the money. X got 7.018400% of the wins with 6.837607% of the money. Y got 7.296000% of the wins with 7.122507% of the money. Z got 7.616900% of the wins with 7.407407% of the money.
very cool simulation. that started leveling out very quickly from just 2 accounts to 26.




Cryddit
Legendary
Offline
Activity: 924
Merit: 1130


January 31, 2014, 06:40:48 PM 

And you're looking at a thread in which two different people have posted code.
Both the people made the same error. And you have not yet said what that error is. In fact you flatly refused to on several occasions. The supposed error does not in fact exist. You were right when you said that the artificial situation of just two accounts exaggerated the effect; That doesn't mean there was an error  the bias unquestionably exists. So I only have one question; why are you pretending to have a problem understanding this?
Already answered why ur model is incorrect. Sorry, I'm not going to waste my time on every guy who does a logical error. Nope, sorry. Remember, You flatly refused to explain. You don't get to flatly refuse to explain, and then claim that you did. The model is correct; The only question is, does it matter? And the answer given the broader simulation above is, probably not. With many accounts no one having more than a small fraction of the total money, the bias is very small. But it definitely does exist.




