Results 1 to 9 of 9

Thread: I will give you half a Bitcoin if you can solve this problem.

  1. #1
    a cantori prometheus's Avatar
    Type
    INTj
    Join Date
    Jan 2014
    Location
    the deep end
    Posts
    1,868

    I will give you half a Bitcoin if you can solve this problem.

    EDIT: Sorry, I should have put this in The Playground, not quite used to the new website yet .

    .5 BTC = around 450 USD at the moment.

    Ok, imagine there are one billion tickets created. These one billion tickets are distributed extremely unevenly amongst an unknown number of accounts, each represented by an account number.

    IE. One account has 50 Million, another only has 50k

    One account may have as many as 100 million tickets, or as few as 1. An individual with one account may create as many additional accounts as he likes, and distribute his ticket(s) to said accounts freely.

    Your task: design a voting system based on the following variables that assures fairness given the initial skewed distribution of tickets. In other words, someone with 100 million tickets is not 100 million times more powerful in terms of voting power compared to someone with 1.

    Ideally one person's vote would equal another's regardless of the number of tickets one is holding.

    Account Age
    Account Balance
    Number of Total Votes Cast

    The closest I have come to solving this is

    votingweight = ( 1 / similarity ) ^ (4/3) * (accountbalance)^(1/3) * (accountage)^2 (timesvoted)^(3/2)

    Where similarity is a number that increases as two separate accounts make the same voting decisions repeatedly, indicating that they are controlled by the same person.

    Here is what my solution looks like in PHP, however it is not perfect.
    [spoiler]
    Code:
    $accountNumber = $_POST['account']
    $option = $_POST['option']
    
    $TotalIssuesVotedOn = file_get_contents("MasterVoteCount.txt");
    $similarityModifier = file_get_contents($accountNumber . "/similarity.txt");
    $accountBalance = file_get_contents($accountNumber . "/balance.txt");
    $accountAge = file_get_contents($accountNumber . "/age.txt");
    
    
    $nxtAge = something goes here;
    
    <!-- Times voted is retrieved and updated ---!>
    $filename = "$accountNumber" . "/timesvoted.txt";
    	if (file_exists($filename)) 
    {
    
        $oldData = file_get_contents($filename);
        $newData = $oldData + 1;
        file_put_contents($filename, $newData);
        
    } 
    	else 
    {
        $newData = 1;
        file_put_contents($filename, $newData);
    }
    <!-- Times voted is retrieved and updated ---!>
    
    $TimesVoted = file_get_contents("$accountNumber" . "/timesvoted.txt");
    $TotalIssuesVotedOn = file_get_contents("MasterVoteCount.txt");
    
    <!-- Account is added to vote ---!>
    $votes = '';
    $filename = $TotalIssuesVotedOn . "/" . $option . "votes.txt";
    	if (file_exists($filename)) 
    {
    
        $oldData = unserialize(file_get_contents($filename));
        $oldData = array();
        $oldData['account'] = $accountNumber;
        $oldData['weight'] = ( 1 / ( $similarityModifier + 1 ) ) ^ (5/4) * ( $accountAge ) ^ 2 ( $accountBalance ) ^ (1/3)
        $newData = serialize($oldData);
        file_put_contents($filename, $newData);
        
    } 
    	else 
    {
    	$oldData = array();
        $oldData['account'] = $accountNumber;
        $oldData['weight'] = ( 1 / ( $similarityModifier + 1 ) ) ^ (5/4) * ( $accountAge ) ^ 2 ( $accountBalance ) ^ (1/3)
        $newData = serialize($oldData);
        file_put_contents($filename, $newData);
    }
    <!-- Account is added to vote ---!>
    Code:
    $optionOne = $_POST['option1']
    $optionTwo= $_POST['option2']
    
    $TotalIssuesVotedOn = file_get_contents("MasterVoteCount.txt");
    
    $DataOne = unserialize(file_get_contents($optionOne . ".txt"));
    $VotesOne = array_sum($DataOne['weight']) ;
    
    $DataTwo = unserialize(file_get_contents($optionTwo . ".txt"));
    $VotesTwo = array_sum($DataTwo['weight'])
    
    if($VotesTwo < $VotesOne)
    {
       
    	echo "Option One Wins";
    	
    	$split = 1 - $VotesOne / ($VotesTwo + $VotesOne);
    	$BankA = $DataOne['account'];
    	$newData = serialize($BankA);
       
    	file_put_contents("BankA" . $TotalIssuesVotedOn . ".txt", $newData);
    }
       
       else
    {
       $split = 1 - $VotesTwo / ($VotesTwo + $VotesOne);
       echo "Option Two Wins";
       
         $BankA = $DataTwo['account'];
         
        $newData = serialize($BankA);
         
    	file_put_contents("BankA" . $TotalIssuesVotedOn . ".txt", $newData);
    }
    
    $splitfilename = "Issue" . "$TotalIssuesVotedOn" . "/split.txt";
    
    file_put_contents($splitfilename, $split);
    file_put_contents("MasterVoteCount.txt", $TotalIssuesVotedOn);
    
    if($TotalIssuesVotedOn < 4)
    {
    	echo "completed";
    }
    	else 
    {
    	$var_a = $TotalIssuesVotedOn - 1
    	$var_b = $TotalIssuesVotedOn - 2
    	$var_c = $TotalIssuesVotedOn - 3
    
    	$splitA = file_get_contents("Issue" . "$TotalIssuesVotedOn" . "/split.txt"); 
    	$splitB = file_get_contents("Issue" . "$var_a" . "/split.txt"); 
    	$splitC = file_get_contents("Issue" . "$var_b" . "/split.txt"); 
    	$splitD = file_get_contents("Issue" . "$var_c" . "/split.txt"); 
    
    	$Bank1 = file_get_contents("BankA" . $TotalIssuesVotedOn . ".txt");
    	$Bank2 = file_get_contents("BankA" . $var_a . ".txt");
    	$Bank3 = file_get_contents("BankA" . $var_b . ".txt");
    	$Bank4 = file_get_contents("BankA" . $var_c . ".txt");
    
    	$AllBanks = array(  $Bank1,
                       		$Bank2,
                      		$Bank3,
                       		$Bank4
                     	 );
    
    	$SimilarAccounts = call_user_func_array('array_intersect',$AllBanks);
    
    	$var_d = array_sum($SimilarAccounts);
    
    	$similarityAdded = .1 / ($splitA * $splitB * $splitC * $splitD);
     
    
    	$var_e = 0;
    		while ($var_e < ($var_d - 1))
      		{
     		 $similarityModifier = file_get_contents($SimilarAccounts[$var_e] . "/similarity.txt");
      
      		 $similarityModifier = $similarityModifier + $similarityAdded;
      
      		 file_put_contents($SimilarAccounts[$var_e] . "/similarity.txt", $similarityModifier);
      
      		 $var_e = $var_e + 1;
      		}
    }
    $TotalIssuesVotedOn = $TotalIssuesVotedOn + 1;
    [/spoiler]

    This doesn't work as similarity can be defeated by voting randomly on issues that someone with multiple accounts doesn't care about...

    For more info https://bitcointalk.org/index.php?topic=345619.22500.

  2. #2
    techno-hippie Chopper Challenge Champion Deckard's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Posts
    352
    If your dupe account detection isn't reliable (which it appears it wouldn't be, based voting patterns alone), this is unsolvable without changing the premises.

    To solve it you would need to give some advantage to the more wealthy accounts, or have a better way of detecting dupes, like tracing where each account was funded from, which again is probably impossible given that presumably this is about anonymous cryptocurrency transacitons.
    Last edited by Deckard; 01-21-2014 at 04:54 AM.

  3. #3
    Species 5618 LordLatch's Avatar
    Type
    INtP
    Join Date
    Dec 2013
    Location
    Vinculum
    Posts
    4,185
    Are you designing a new altcoin?
    /Poignant comment containing the secrets of the universe.
    Spoiler: * Legal Disclaimer *
    All of my posts are written by 127 person committee from all over the world who vote on everything I say. Two of those people are russian chatbots and one person is mentally retarded who votes loudly so sometimes his vote gets counted twice. Grammatical errors and logical fallacies are added by a partially literate hobo who is forever huffing gold paint to simulate realism and the finished message is typed in by chimp.

  4. #4
    a cantori prometheus's Avatar
    Type
    INTj
    Join Date
    Jan 2014
    Location
    the deep end
    Posts
    1,868
    Quote Originally Posted by latch View Post
    Are you designing a new altcoin?
    I wish, this is just the voting system for NXT. (New all time high on coinmarketcap.com btw )

    Quote Originally Posted by Deckard View Post
    If your dupe account detection isn't reliable (which it appears it wouldn't be, based voting patterns alone), this is unsolvable without changing the premises.

    To solve it you would need to give some advantage to the more wealthy accounts, or have a better way of detecting dupes, like tracing where each account was funded from, which again is probably impossible given that presumably this is about anonymous cryptocurrency transacitons.
    It is ok if more wealthy accounts have some advantage, but it can not be a linear advantage. On this premise I believe a solution is logically feasible.

  5. #5
    Species 5618 LordLatch's Avatar
    Type
    INtP
    Join Date
    Dec 2013
    Location
    Vinculum
    Posts
    4,185
    Quote Originally Posted by prometheus View Post
    I wish, this is just the voting system for NXT. (New all time high on coinmarketcap.com btw )
    AHA! I thought you were who I thought you were. And I was right.

    Just leave account balance out of the equation and allow one vote per account.

    If you want account balance to have some factor in it but very little that you lower its influence relative to the other factor.

    What is the range of the vote 'weight' variable you are aiming for?
    Last edited by LordLatch; 01-21-2014 at 05:51 AM.
    /Poignant comment containing the secrets of the universe.
    Spoiler: * Legal Disclaimer *
    All of my posts are written by 127 person committee from all over the world who vote on everything I say. Two of those people are russian chatbots and one person is mentally retarded who votes loudly so sometimes his vote gets counted twice. Grammatical errors and logical fallacies are added by a partially literate hobo who is forever huffing gold paint to simulate realism and the finished message is typed in by chimp.

  6. #6
    techno-hippie Chopper Challenge Champion Deckard's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Posts
    352
    Quote Originally Posted by prometheus View Post
    It is ok if more wealthy accounts have some advantage, but it can not be a linear advantage. On this premise I believe a solution is logically feasible.
    If the dupe detection is entirely unreliable then the obvious attack is to create ~infinite dupes. I just don't see how you would go about differentiating between multiple (genuine) individual accounts voting the same way and a bunch of dupes voting the same way.
    Last edited by Deckard; 01-21-2014 at 06:50 AM.

  7. #7
    Anthropos mhc's Avatar
    Type
    iNtP
    Join Date
    Feb 2014
    Posts
    484
    i stumbled upon this thread, sorry i know its nearly 6 months old, but why ID each vote by an account name when a user can create more freely? can not the freely created user accounts have a separate, non-voteable ID? are you trying to avoid the user having to set up a unique account on initial acquisition of the coin?
    Do you see a face or a breakfast of eggs and sausage

  8. #8
    Member joft's Avatar
    Type
    intp
    Join Date
    Dec 2013
    Location
    Californication
    Posts
    364
    a random number generator decides the vote

    it's fair

  9. #9
    Member HilbertSpace's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Posts
    136
    I think the problem might need additional constraints, but I'd suggest including:

    1. Machine learning like learning classifier systems to decompose voting patterns into vector spaces with don't care wildcards to determine voting patterns
    2. Logarithmic discounting of vote counts along these vectors to linearize the vote counting function
    3. Uncertainty quantification by introducing noise into the model to prevent overfitting
    4. Calculate confidence intervals to see if you can unambiguously determine the popular vote

    However, you might be able to improve things by introducing more complexity to the voting process. If you require essay style voting (not only how you vote but why) you can increase the expense of voting proportionally to the number of votes cast, as long as you can detect spam there (which is not too hard) . Basically you raise the cost for multiple votes and use computational linguistics to detect ballot stuffing. It would be harder to spam - sort of like a Turing test for vote counting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •