• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Pre-Proposal: Would you like to be able to vote with number? (v2)

Would you like to be able to cast votes using numbers and extract the results as an average?


  • Total voters
    6

vazaki3

Well-known member
The original thread was locked, so I repost the thread, in order for the discussion to be continued, and most importantly, in order for the vote to be continued.

This is a question to all masternode owners.

In the budget system you are allowed to vote only by using a yes or a no.
Would you like to be able to cast a vote using numbers, into specially designed for that purpose polls?
The result of the vote is extracted by calculating the average of all numerical votes.

<locked thread's vote history>
Would you like to be able to cast votes using numbers and extract the results as an average?
</locked thread's vote history>
 
Last edited:
Read the article of @Pietro Speroni

Let the DAO decide “how much” – Pietro Speroni di Fenizio, PhD

Pietro Speroni said:
I proposed this in July of this year (2021) to the Dash Incubator (another part of the Dash Democracy), and it was then approved. So hopefully it should see the light of day soon enough. Part of the aim of this document is to explain to masternode owners what this change would entail, and why we should adopt it.

image.png
 
Last edited:
Below I delete the heretic views of @Pietro Speroni , that are against the orthodox way of voting the numbers.

"It’s very important that we pick the median and not the average (also known as the mean), the reason will be clear after. If you order all the votes from the lowest to the highest one, the median will be the vote in the middle (if the number of votes is odd) or halfway between the two middle votes (if the number of votes is even). The standard voting procedures apply: you should not be allowed to see what others have voted before the end of the voting period… but in this case, it does not really matter; voting should be anonymous… but the system works also if it is not anonymous. In short, it is a very robust decision-making system."
 
Last edited:
"So why it is important to use the median and not the average? Because a single person can manipulate the average by throwing in an impossibly high or low number." ..........

Pietro is a mathematician, and thinks as a mathematician. But despite what the mathematicians claim, numbers are not infinitive. In reality, in nature, there is always a maximum and a minumum. Even the whole universe is bounded. So a voter should be allowed to vote for this physical maximum or minimum. He should not be allowed to vote for irrational numbers that have no impact to reality.

In nature, most of the times voting occurs by using the mean average. So the natural average is the mean average.
The median average is a rare voting method in nature, mostly it is a human concept, that may be of course applied to the societies of the enslaved human beeings if they want it, but it is NOT mandatorily applied to the free spirits which have the freedom to choose whatever method they like, as long as the method can adapt to the reality of the nature.

As long as the voting choices are bounded between a max and a minimum rational number, a result can always be extracted when voting the numbers. Someone may claim that if we allow the maximum or minimum possible number to be voted, and we use the mean average in order to extract the result, then the result will be irrational. The result turns irrational because irrational is the method used to extract the result. Depending on the question, the voters should be allowed to select their prefered method. They should not be forced to chose only the condorcet method. If they ask you to vote a number between 1-256, never vote a single number (for ex.123). You should always vote (123,mean) or (123,median) or (123, whatever method you may think) . Or even better, instead of 123 , you can also use sliders.This is known as double vote, and this is how spirits vote. (They actually vote by using a triple vote, not to mention the conditional votes, but let me explain these later on)

............. "In fact if someone knew all the votes so far, and were the last person to vote could generally get the value they wanted simply by voting a number high enough or low enough (negative numbers included for this)"

There is no such thing as "the last person to vote". Voting never expires. Nature is always in motion, and always votes. So in case someone votes the maximum number, the other voters can change their mind and vote the minimum, in order to stabilize the result. When voting, you should always take into account the votes of the others, otherwise your vote is stupid. Voters should be educated to the games theory.
 
Last edited:
In order to extract the result of the poll, you should take into account both current votes and the votes of the locked thread, provided of course that the voters of the locked thread are not dead.

<vote history>
Would you like to be able to cast votes using numbers and extract the results as an average?
  • yes
    Votes: 2 -- 66.7%
  • no
    Votes: 1 -- 33.3%
  • other
    Votes: 00.0%
  • yes, but only for the median average
    Votes: 00.0%

  • Total voters 3
</vote history>


DASH IS EXACTLY WHAT THE MASTERNODES ARE VOTING.

THE
MASTERNODES KEEP VOTING SHIT, THATS WHY DASH REMAINS SHIT!
 
Last edited:
In order to extract the result of the poll, you should take into account both current votes and the votes of the locked thread, provided of course that the voters of the locked thread are not dead.

<vote history>
Would you like to be able to cast votes using numbers and extract the results as an average?
  • Total voters 4

</vote history>
 
Pietro is a mathematician, and thinks as a mathematician. But despite what the mathematicians claim, numbers are not infinitive. In reality, in nature, there is always a maximum and a minumum. Even the whole universe is bounded. So a voter should be allowed to vote for this physical maximum or minimum. He should not be allowed to vote for irrational numbers that have no impact to reality.

Another proof that infinitive does not exist, and that the mathematicians that rely on infinitive in order to prove their theories may are wrong.
1+2+3+4+5+......= -1/12

1+2+3+4+5+... = -1/12 ??? Infini 5 - YouTube
ASTOUNDING: 1 + 2 + 3 + 4 + 5 + ... = -1/12 - YouTube

Of course some mathematicians refuse the above theory, and in an imaginary mathematical world they may be right.

1 + 2 + 3 + 4 + ⋯ - Wikipedia
Numberphile v. Math: the truth about 1+2+3+...=-1/12 - YouTube

But the truth is that in reality infinitive does not exist. Nothing in the universe is infinitive.

Some more proof about it.
Riemann's paradox: pi = infinity minus infinity - YouTube

The high school students suspect that infinite does not exist, but the propaganda of the proponents of infinity is huge.
 
Last edited:
You may think that there is no way to vote the numbers in the current budget voting system. Well, there is!
So, how can we vote the numbers in the current budget system?

Simple, you have to use the TERNARY or ΤRINARY or BASE3 NUMERAL system

If you make the assumption that NO_VOTE=0, ABSTAIN_VOTE=1, and YES_VOTE=2 , then you can vote numbers from 0-2.
if you cast TWO proposals (at the cost of 2 dash proposal fee) under the TERNARY system, then you can vote numbers from 0-8
if you cast THREE proposals (at the cost of 3 dash proposal fee) under the TERNARY system, then you can vote numbers from 0-26.

So if you want to vote from 0 to 100 and you afford to pay for 3 proposals, you can divide (100-0)/26=3.84. Your chunk is 3.84 and thus if the average of the voting result of the budget vote is 1 then 3.84 is voted, if the average result of the budget vote is 10 then 38.4 is voted, if the average result of budget vote is 15 then 57.6 is voted e.t.c.

By adding a fourth proposal, you can have 80 divisions, by adding a fifth proposal you can have 242 divisions, so you can increase the granularity of your vote.

Finally, you can also use the BASE4 numeral system (DIDNT_VOTE=0, ABSTAIN_VOTE=1, NO_VOTE=2 and YES_VOTE=3). You make the assumption that the people who voted in at least one numeral proposal, declare a 0 vote to all the rest proposals that are associated to it.

Example: by using the 4base, with just 2 proposals (at the cost of 2 dash proposal fee) you can have 15-1=14 divisions (because the 00 vote is not a valid vote in that case, and it is used to calculate the voting participation).
proposal1, proposal2
didnt vote, didnt vote = 00 base4 = decimal 0 (didnt vote at all, invalid number. This is used to calculate abstention and thus decide whether the voting result is legitimate.)
didnt vote, abstain = 01 base4 = decimal 1
didnt vote, no = 02 base4 = decimal 2
didnt vote, yes = 03 base4 = decimal 3
abstain, didnt vote = 10 base4 = decimal 4
abstain, abstain = 11 base4 = decimal 5
abstain, no = 12 base4 = decimal 6
abstain, yes = 13 base4 = decimal 7
no , didnt vote = 20 base4 = decimal 8
no, abstain = 21 base4 = decimal 9
no, no = 22 base4 = decimal 10
no, yes = 23 base4 = decimal 11
yes, didnt vote = 30 base4 =decimal 12
yes, abstain = 31 base4 =decimal 13
yes, no = 32 base4 = decimal 14
yes, yes = 33 base4 = decimal 15

Warning: If you want the masternodes to be able to fully rollback and change their vote, then BASE3 is more suitable, because in BASE4 when you vote 1(abstain), 2(no) or 3(yes) you cannot rollback to 0(didnt vote). This due to the code written by DCG which does not allow the masternodes to undo their vote.
Warning 2: For both Base4 and Base3 you may want to change the semantics of the vote and make it for example 0=no, 1=didnt_vote, 2=abstain, 3=yes or whatever combination, in case you can guess what the majority of the masternodes will vote. In case you can guess succesfully and rearrange the semantics so that "yes" is the most probable, this will resut for you to pay less proposal fee.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Here follows a practical application of the above:

You have done some work for the community but you dont know how much your job worths (or you dont want to say it). In that case you can ask the masternodes to vote the numbers about it ( look also at "Vote The Numbers (mnowatch.org)" ). When the compensation number is defined/voted, you can then ask again the masternodes (in another proposal) for the final yes/no on the specific number, and get paid from the budget.

By applying BASE4, and in case you are using 3 proposals (at the cost of 3 dash proposal fee) , you can have chunks of 4592/62=74 dash. Assuming that you define the payment range from 0 to 4592 dash (the whole monthly budget), every masternode is allowed to vote for your reward to be either 0 dash or 74 dash or 148 dash or 222 dash or 296 dash e.t.c. ... or 4592 dash. This is the single numerical vote.

You also have to define the method that will be used to extract the result from the numerical votes. There are some available methods you can arbitrarily choose: the most voted number, the median average, the mean average, the majority, the absolute majority, the strong majority, the unanimity. In case you dont even want to arbitrarily select that method, you can ask the masternodes about it , by issuing another numerical vote that will allow the masternodes to select among available methods. The winner method in that case should respect itself (the bold rule). This is the double numerical vote.

Finnaly you have to decide the minimum voting participation that makes a result legitimate. You can arbitrarily decide that, or you can again ask the masternodes about it. This requires yet another numerical vote to be made, that also depends on the aforementioned bold rule. This is the triple numerical vote.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

There are 10 kinds of humans. These who understand the above, and these who do not.
Do NOT follow the hollow. Vote the numbers!
 
Last edited:
I think base3 is very confusing, either way, I think Dash Platform could be used for governance and if that is the case, then perhaps the designers can consider something like this to make it more granular that what we have now?
 
I think base3 is very confusing, either way, I think Dash Platform could be used for governance and if that is the case, then perhaps the designers can consider something like this to make it more granular that what we have now?

The official governance system of Dash is the budget system.

This is where the Dash community decides, there is no other place.

If we want to pass the governance credentials to another system and bypass the budget, I would rather prefer mnowatch.org to become the official governance system of Dash rather than the DashPlatform. :p
 
You may think that there is no way to vote the numbers in the current budget voting system. Well, there is!
So, how can we vote the numbers in the current budget system?

Simple, you have to use the TERNARY or ΤRINARY or BASE3 NUMERAL system

If you make the assumption that NO_VOTE=0, ABSTAIN_VOTE=1 and YES_VOTE=2 , then you can vote numbers from 0-2.
if you cast TWO proposals (at the cost of 2 dash proposal fee) under the TERNARY system, then you can vote numbers from 0-8
if you cast THREE proposals (at the cost of 3 dash proposal fee) under the TERNARY system, then you can vote numbers from 0-26.

So if you want to vote from 0% to 100% and you afford to pay for 3 proposals, you can divide 100/26=3.84 and thus if the average of the voting result of the budget vote is 1 then 3.84% is voted, if the average result of the budget vote is 10 then 38.4% is voted, if the average result of budget vote is 15 then 57.6% is voted e.t.c.

By adding a fourth proposal, you can have 80 chunks, by adding a fifth proposal you can have 242 chunks, so you can increase the granularity of your vote.

Finally, you can also use the BASE4 numeral system (DIDNT_VOTE=0, ABSTAIN_VOTE=1, NO_VOTE=2 and YES_VOTE=3). You make the assumption that the people who voted in at least one numeral proposal, declare a 0 vote to all the rest proposals that are associated to it.

Example: by using the 4base, with just 2 proposals (at the cost of 2 dash proposal fee) you can have 15-1=14 chunks (because the 00 vote is not a valid vote in that case, and it is used to calculate the voting participation).
proposal1, proposal2
didnt vote, didnt vote = 00 base4 = decimal 0 (didnt vote at all, invalid number. This is used to calculate abstention and thus decide whether the voting result is legitimate.)
didnt vote, abstain = 01 base4 = decimal 1
didnt vote, no = 02 base4 = decimal 2
didnt vote, yes = 03 base4 = decimal 3
abstain, didnt vote = 10 base4 = decimal 4
abstain, abstain = 11 base4 = decimal 5
abstain, no = 12 base4 = decimal 6
abstain, yes = 13 base4 = decimal 7
no , didnt vote = 20 base4 = decimal 8
no, abstain = 21 base4 = decimal 9
no, no = 22 base4 = decimal 10
no, yes = 23 base4 = decimal 11
yes, didnt vote = 30 base4 =decimal 12
yes, abstain = 31 base4 =decimal 13
yes, no = 32 base4 = decimal 14
yes, yes = 33 base4 = decimal 15

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here follows a practical application of the above:

You have done some work for the community but you dont know how much your job worths (or you dont want to say it). In that case you can ask the masternodes to vote the numbers about it ( look also at "Vote The Numbers (mnowatch.org)" ). When the compensation number is defined/voted, you can then ask again the masternodes (in another proposal) for the final yes/no on the specific number, and get paid from the budget.

By applying BASE4, and in case you are using 3 proposals (at the cost of 3 dash proposal fee) , you can have chunks of 4592/62=74 dash. Assuming that you define the payment range from 0 to 4592 dash (the whole montlhy budget), every masternode is allowed to vote for your reward to be either 74 dash or 148 dash or 222 dash or 296 dash e.t.c. ... or 4592 dash. This is the single numerical vote.

You also have to define the method that will be used to extract the result from the numerical votes. There are some available methods you can arbitrarily choose: the median average, the mean average, the majority, the absolute majority, the strong majority, the unanimity. In case you dont even want to arbitrarily select that method, you can ask the masternodes about it , by issuing another numerical vote that will allow the masternodes to select among available methods. The winner method in that case should respect itself (the bold rule). This is the double numerical vote.

Finnaly you have to decide the minimum voting participation that makes a result legitimate. You can arbitrarily decide that, or you can again ask the masternodes about it. This requires yet another numerical vote to be made, that also depends on the aforementioned bold rule. This is the triple numerical vote.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

There are 10 kinds of humans. These who understand the above, and these who do not.
Do NOT follow the hollow. Vote the numbers!


Here is a script I wrote that discovers the most voted number in a numerical vote of masternodes, for a given set of proposals (and for the BASE4 system).

Code:
#!/bin/bash
#script's arguments: <mnowatch csvfile> <proposal for the 1st digit> <proposal for the 2nd digit>  ..... <proposal for the nth digit>
csvfile=$1
props=`echo $@|cut -f2- -d" "`
echo BASE4 voting
echo CSVFILE=$csvfile
echo PROPOSALS=$props
wget -q http://mnowatch.org/$csvfile
my_awk_cmd="awk -F, '"
my_awk_cmd_2ndpart="s/\n/ /g"
my_awk_cmd_3ndpart="cut -f1"
my_awk_cmd_4ndpart="grep -v '\""
countit=0
for fn in `echo $props`; do
my_awk_cmd=$my_awk_cmd"\$3 ~ \"$fn\" {print \$1 \" 3\"} \$4 ~ \"$fn\" {print \$1 \" 2\"} \$5 ~ \"$fn\" {print \$1 \" 1\"} !/$fn/ {print \$1 \" 0\"} "
my_awk_cmd_2ndpart="N;"$my_awk_cmd_2ndpart
countit=`expr $countit + 2`
my_awk_cmd_3ndpart=$my_awk_cmd_3ndpart",$countit"
my_awk_cmd_4ndpart=$my_awk_cmd_4ndpart" 0"
done
my_awk_cmd_2ndpart=`echo $my_awk_cmd_2ndpart|cut -f2- -d';'`
my_awk_cmd=$my_awk_cmd"' $csvfile|sed '$my_awk_cmd_2ndpart'|$my_awk_cmd_3ndpart -d' '|$my_awk_cmd_4ndpart\$'|cut -f3 -d'\"'|sed -e 's/ //g'"
mediumis=`eval $my_awk_cmd |sort|uniq -c|rev|sed -e 's/ /:/1'|rev|sort -t":" -k1 -nr|head -1|cut -f2 -d:`
echo most voted number = $((4#$mediumis)) "(decimal)"

Please test it (by assuming that the current proposals of the budget are numerical proposals) and report bugs.


example of testing the script
Code:
12K ~/votethenum/fromforum
22:25 demo<0>apogee 0 $ date;./forum.sh the_results_dashd_2023-03-29-00-52-12.html.csv dash-marketing-hub-brave-maya DCG-COMP-APR-JUN23 DCG-Infra-Apri-May-2022 mnowatch-hosting-2023; date
Wed Mar 29 10:26:08 PM UTC 2023
BASE4 voting
CSVFILE=the_results_dashd_2023-03-29-00-52-12.html.csv
PROPOSALS=dash-marketing-hub-brave-maya DCG-COMP-APR-JUN23 DCG-Infra-Apri-May-2022 mnowatch-hosting-2023
most voted number = 255 (decimal)
Wed Mar 29 10:26:09 PM UTC 2023
868K ~/votethenum/fromforum
22:26 demo<0>apogee 0 $

Coming soon, a script that calculates the median average of all votes.
 
Last edited:
Coming soon, a script that calculates the median average of all votes.

Code:
#!/bin/bash
#script's arguments: <mnowatch csvfile> <proposal for the 1st digit> <proposal for the 2nd digit>  ..... <proposal for the nth digit>
csvfile=$1
props=`echo $@|cut -f2- -d" "`
echo BASE4 voting
echo CSVFILE=$csvfile
echo PROPOSALS=$props
wget -q http://mnowatch.org/$csvfile
my_awk_cmd="awk -F, '"
my_awk_cmd_2ndpart="s/\n/ /g"
my_awk_cmd_3ndpart="cut -f1"
my_awk_cmd_4ndpart="grep -v '\""
countit=0
for fn in `echo $props`; do
my_awk_cmd=$my_awk_cmd"\$3 ~ \"$fn\" {print \$1 \" 3\"} \$4 ~ \"$fn\" {print \$1 \" 2\"} \$5 ~ \"$fn\" {print \$1 \" 1\"} !/$fn/ {print \$1 \" 0\"} "
my_awk_cmd_2ndpart="N;"$my_awk_cmd_2ndpart
countit=`expr $countit + 2`
my_awk_cmd_3ndpart=$my_awk_cmd_3ndpart",$countit"
my_awk_cmd_4ndpart=$my_awk_cmd_4ndpart" 0"
done
my_awk_cmd_2ndpart=`echo $my_awk_cmd_2ndpart|cut -f2- -d';'`
my_awk_cmd=$my_awk_cmd"' $csvfile|sed '$my_awk_cmd_2ndpart'|$my_awk_cmd_3ndpart -d' '|$my_awk_cmd_4ndpart\$'|cut -f3 -d'\"'|sed -e 's/ //g'"
validvotes=`eval $my_awk_cmd |sort | wc -l`
echo "validVotes "$validvotes" (decimal)"
mostvoted=`eval $my_awk_cmd |sort|uniq -c|rev|sed -e 's/ /:/1'|rev|sort -t":" -k1 -nr|head -1|cut -f2 -d:`
echo "mostVoted = "$((4#$mostvoted))" (decimal)"
median=`eval $my_awk_cmd |sort|tail -n +$(((\`eval $my_awk_cmd |sort | wc -l\` / 2) + 1)) | head -n 1`
echo "medianAverage = "$((4#$median))" (decimal)"


And below, an example on how you can run the above script in order to calculate the results for a numerical voting that uses five proposals (in that case the maximum number a masternode can vote is 33333 (base4) or 1023 decimal)

Code:
55M ~/votethenum/fromforum
00:06 demo<0>apogee 0 $ date;./forum.sh the_results_dashd_2023-03-29-00-52-12.html.csv Broadcast-Radio-FTL dash-marketing-hub-brave-maya DCG-COMP-APR-JUN23 DCG-Infra-Apri-May-2022 mnowatch-hosting-2023;date
Thu Mar 30 12:07:32 AM UTC 2023
BASE4 voting
CSVFILE=the_results_dashd_2023-03-29-00-52-12.html.csv
PROPOSALS=Broadcast-Radio-FTL dash-marketing-hub-brave-maya DCG-COMP-APR-JUN23 DCG-Infra-Apri-May-2022 mnowatch-hosting-2023
validVotes 962 (decimal)
mostVoted = 3 (decimal)
medianAverage = 63 (decimal)
Thu Mar 30 12:07:32 AM UTC 2023
56M ~/votethenum/fromforum
00:07 demo<0>apogee 0 $
 
Last edited:
Warning: If you want the masternodes to be able to fully rollback and change their vote, then BASE3 is more suitable, because in BASE4 when you vote 1(abstain), 2(no) or 3(yes) you cannot rollback to 0(didnt vote). This due to the code written by DCG which does not allow the masternodes to undo their vote.

Now the masternodes can also rollback and change their numercal votes !

Here you are, the BASE3 number voting!


 
Last edited:
Last edited:
I opensource the code that calculates the BASE3 results by taking into account the new Evo Nodes (HCMN) of v19.2

Code:
#!/bin/bash
#set -x
#Supports Evo Nodes -- BASE3 voting
#script's arguments: <mnowatch csvfile> <proposal for the 1st digit> <proposal for the 2nd digit>  ..... <proposal for the nth digit>
csvfile=$1
wget -q http://mnowatch.org/$csvfile
[[ -f "$csvfile" ]] || exit 1
props=`echo $@|cut -f2- -d" "`
my_awk_cmd="awk -F, '"
my_awk_cmd_2ndpart="s/\n/ /g"
my_awk_cmd_3ndpart="cut -f1"
countit=0
for fn in `echo $props`; do
#The semantic is ( NO_VOTE=0, ABSTAIN_VOTE=1 and YES_VOTE=2) and 4 when they didnt vote.
my_awk_cmd=$my_awk_cmd"\$3 ~ \"$fn\" {print \$1 \" 2\"} \$4 ~ \"$fn\" {print \$1 \" 0\"} \$5 ~ \"$fn\" {print \$1 \" 1\"} !/$fn/ {print \$1 \" 4\"} "
my_awk_cmd_2ndpart="N;"$my_awk_cmd_2ndpart
countit=`expr $countit + 2`
my_awk_cmd_3ndpart=$my_awk_cmd_3ndpart",$countit"
done
my_awk_cmd_2ndpart=`echo $my_awk_cmd_2ndpart|cut -f2- -d';'`
my_awk_cmdR="cat $csvfile|grep Regular$|"$my_awk_cmd"'|sed '$my_awk_cmd_2ndpart'|grep -v '\" 4'|$my_awk_cmd_3ndpart -d' '|cut -f3 -d'\"'|sed -e 's/ //g'"
my_awk_cmdH="cat $csvfile|grep HighPerformance$|"$my_awk_cmd"'|sed '$my_awk_cmd_2ndpart'|grep -v '\" 4'|$my_awk_cmd_3ndpart -d' '|cut -f3 -d'\"'|sed -e 's/ //g'"
electorateR=`cat $csvfile|grep Regular$|wc -l`
electorateH=`cat $csvfile|grep HighPerformance$|wc -l`
electorate=`echo "$electorateR + $electorateH*4"|bc -l`
echo "<hr><strong class=\"notit\">Electorate = </strong> $electorate potential votes (Regular and Evo MN)"
validvotesR=`eval $my_awk_cmdR |sort | wc -l`
validvotesH=`eval $my_awk_cmdH |sort | wc -l`
validvotes=`echo "$validvotesR + $validvotesH*4"|bc -l`
echo "<br><strong class=\"notit\">ValidVotes = </strong> "$validvotes" "
participation=`echo "scale=2;((100 * $validvotes) / $electorate)" | bc -l`
echo "<br><strong class=\"notit\">Voting participation = </strong> "$participation" % "
echo "<p><strong class=\"notit\">VOTING RESULTS</strong>"
allvotesRH=`echo $(eval $my_awk_cmdR)" "$(eval $my_awk_cmdH)" "$(eval $my_awk_cmdH)" "$(eval $my_awk_cmdH)" "$(eval $my_awk_cmdH)" -"|sed 's/\n//g'`
mostvotednum=`echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort|uniq -c|rev|sed -e 's/ /:/1'|rev|sort -t":" -k1 -nr|head -1`
mostvotednumtimes=`echo $mostvotednum|cut -f1 -d" "`
mostvoted=`echo $mostvotednum|cut -f2 -d" "|cut -f1 -d:`
participationmostvoted=`echo "scale=2;((100 * $mostvotednumtimes) / $validvotes)" | bc -l`
mostvoted10=`echo "ibase=3;$mostvoted" | bc`
echo "<br><strong class=\"notit\">mostVotedNumber = </strong> $mostvoted10 (or $mostvoted base3) was voted by $mostvotednumtimes votes ( $participationmostvoted % of the valid votes )"
median=`echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort|tail -n +$(((\`echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort | wc -l\` / 2) + 1)) | head -n 1` #do I have a bug here in case of odd/even number of votes?
median10=`echo "ibase=3;$median" | bc`
echo "<br><strong class=\"notit\"><a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Median\">median</a>Average = </strong> $median10 (or $median base3)"
resunum=0
meanAverage=`echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort|uniq -c|rev|cut -f2- -d" "|sed -e 's/ /:/1'|rev|sort -t":" -k1 -nr`
for dn in `echo $meanAverage`; do
 multi=`echo $dn|cut -f1 -d:`
 numi=`echo $dn|cut -f2 -d:`
 numidec=`echo "ibase=3;$numi" | bc`
 resu=`echo "($multi * $numidec)"|bc -l`
 resunum=`expr $resunum + $resu`
done
finalavg=`echo "scale=2;( $resunum / $validvotes)" | bc -l`
echo "<br><strong class=\"notit\"><a target=\"_blank\" href=\"https://simple.wikipedia.org/wiki/Mean\">mean</a>Average = </strong> "$finalavg
echo "<hr><details><summary>The Votes</summary><strong class=\"notit\">The Votes (base3)</strong> <br>"
echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort
echo "</details>"

Run the script to crosscheck the results presented below:

 
Last edited:
I opensource the code that calculates the BASE3 results by taking into account the new Evo Nodes (HCMN) of v19.2

New version 4 of the code that calculates the BASE3 results. It removes the POSE_BANNED masternodes from the electorate.

It is only compatible with dashd v20 (I renamed the "grep HighPerformance$" command to "grep Evo$" as required by the v20 specs).

For backwards compatibility, use the verson 3 of this code (just rename "Evo" back to "HighPerformance").

Bash:
#!/bin/bash
#set -x
#Supports Evo Nodes -- BASE3 voting. Script version 4 (compatible with dashd v20)
#script's arguments: <mnowatch csvfile> <proposal for the 1st digit> <proposal for the 2nd digit>  ..... <proposal for the nth digit>
[[ $1 == "" ]] & echo "script's arguments: <mnowatch csvfile> <proposal for the 1st digit> <proposal for the 2nd digit>  ..... <proposal for the nth digit>"
csvfile=$1
mysiteis=mnowatch.org #put your site here, in case you run mnowatch code in a different site
wget -q http://$mysiteis/$csvfile
[[ -f "$csvfile" ]] || exit 1
props=`echo $@|cut -f2- -d" "`
my_awk_cmd="awk -F, '"
my_awk_cmd_2ndpart="s/\n/ /g"
my_awk_cmd_3ndpart="cut -f1"
countit=0
for fn in `echo $props`; do
#NOTE: The semantic is ( NO_VOTE=0, ABSTAIN_VOTE=1 and YES_VOTE=2) and 4 when they didnt vote.
my_awk_cmd=$my_awk_cmd"\$3 ~ \"$fn\" {print \$1 \" 2\"} \$4 ~ \"$fn\" {print \$1 \" 0\"} \$5 ~ \"$fn\" {print \$1 \" 1\"} !/$fn/ {print \$1 \" 4\"} "
my_awk_cmd_2ndpart="N;"$my_awk_cmd_2ndpart
countit=`expr $countit + 2`
my_awk_cmd_3ndpart=$my_awk_cmd_3ndpart",$countit"
done
my_awk_cmd_2ndpart=`echo $my_awk_cmd_2ndpart|cut -f2- -d';'`
my_awk_cmdR="cat $csvfile|grep -v ',POSE_BANNED$'|cut -f1-10 -d,|grep Regular$|"$my_awk_cmd"'|sed '$my_awk_cmd_2ndpart'|grep -v '\" 4'|$my_awk_cmd_3ndpart -d' '|cut -f3 -d'\"'|sed -e 's/ //g'"
my_awk_cmdH="cat $csvfile|grep -v ',POSE_BANNED$'|cut -f1-10 -d,|grep Evo$|"$my_awk_cmd"'|sed '$my_awk_cmd_2ndpart'|grep -v '\" 4'|$my_awk_cmd_3ndpart -d' '|cut -f3 -d'\"'|sed -e 's/ //g'"
electorateR=`cat $csvfile|grep -v ',POSE_BANNED$'|cut -f1-10 -d,|grep Regular$|wc -l`
electorateH=`cat $csvfile|grep -v ',POSE_BANNED$'|cut -f1-10 -d,|grep Evo$|wc -l`
electorate=`echo "$electorateR + $electorateH*4"|bc -l`
echo "<hr><strong class=\"notit\">Electorate = </strong> $electorate potential votes (Regular and Evo MNOs)"
validvotesR=`eval $my_awk_cmdR |sort | wc -l`
validvotesH=`eval $my_awk_cmdH |sort | wc -l`
validvotes=`echo "$validvotesR + $validvotesH*4"|bc -l`
echo "<br><strong class=\"notit\">ValidVotes = </strong> "$validvotes" "
participation=`echo "scale=2;((100 * $validvotes) / $electorate)" | bc -l`
echo "<br><strong class=\"notit\">Voting participation = </strong> "$participation" % "
echo "<p><strong class=\"notit\">VOTING RESULTS (depends on which among the below election methods you prefer.)</strong>"
echo "<p><strong class=\"notit\">Divisive election methods</strong>"
allvotesRH=`echo $(eval $my_awk_cmdR)" "$(eval $my_awk_cmdH)" "$(eval $my_awk_cmdH)" "$(eval $my_awk_cmdH)" "$(eval $my_awk_cmdH)" -"|sed 's/\n//g'`
mostvotednum=`echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort|uniq -c|rev|sed -e 's/ /:/1'|rev|sort -t":" -k1 -nr|head -1`
mostvotednumtimes=`echo $mostvotednum|cut -f1 -d" "`
mostvoted=`echo $mostvotednum|cut -f2 -d" "|cut -f1 -d:`
participationmostvoted=`echo "scale=2;((100 * $mostvotednumtimes) / $validvotes)" | bc -l`
mostvoted10=`echo "ibase=3;$mostvoted" | bc`
echo "<br><strong class=\"notit\">mostVotedNumber method = </strong> $mostvoted10 (or $mostvoted base3) was voted by $mostvotednumtimes votes ( $participationmostvoted % of the valid votes )"
echo "<p><strong class=\"notit\">Inclusive election methods</strong>"
median=`echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort|tail -n +$(((\`echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort | wc -l\` / 2) + 1)) | head -n 1`
#do I have a bug in the calculation of the median above, in case of odd/even number of votes?
median10=`echo "ibase=3;$median" | bc`
echo "<br><strong class=\"notit\"><a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Median\">median</a>Average method = </strong> $median10 (or $median base3)"
resunum=0
meanAverage=`echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort|uniq -c|rev|cut -f2- -d" "|sed -e 's/ /:/1'|rev|sort -t":" -k1 -nr`
for dn in `echo $meanAverage`; do
 multi=`echo $dn|cut -f1 -d:`
 numi=`echo $dn|cut -f2 -d:`
 numidec=`echo "ibase=3;$numi" | bc`
 resu=`echo "($multi * $numidec)"|bc -l`
 resunum=`expr $resunum + $resu`
done
finalavg=`echo "scale=2;( $resunum / $validvotes)" | bc -l`
echo "<br><strong class=\"notit\"><a target=\"_blank\" href=\"https://simple.wikipedia.org/wiki/Mean\">mean</a>Average method = </strong> "$finalavg
echo "<p> <strong class=\"notit\">Note: Multiply the result of your favorite method by the appropriate <a target=\"_blank\" href=\"https://www.dash.org/forum/index.php?threads/pre-proposal-would-you-like-to-be-able-to-vote-with-number-v2.52643/#post-233231\">chunk</a> as defined by the proposal owner.</strong>"
echo "<hr><details><summary>The Votes</summary><strong class=\"notit\">The Votes (base3)</strong> <br>"
echo $allvotesRH|sed 's/ / \n/g'|grep -v -|sort
#TO DO: In a future version display a nice looking graph of all the votes!!!
echo "</details>"

run the script as shown in the example below:
Bash:
./script.sh the_results_dashd_2023-08-28-08-58-54.html.csv encointerUBI-Digit1 encointerUBI-Digit2 encointerUBI-Range-0-242-Digit3

...to crosscheck the results presented below:

 
Last edited:
Back
Top