Is Inequality Inevitable? (Mathematical modeling of free-markets)

The problem here is basically the problem with any ideological fiction: you can set it up to come out any way you want. In this simulation the actors are forced to play one game. That game has given odds with given stakes. And the game is not favourable to poor. It actually isn't very favourable to the wealthy either. Their wealth also decays but more slowly than the poor.

The author is also glorifying his experiment as a simulation. I dusted off my javascript and wrote the same simulation that you can run in your browser.

If you want to run it

  • Copy the code

  • Paste it into notepad

  • Save it as something.html

  • Double click on it and it should open in a broswer

You can mess with the numbers to see what comes up.

<html>
  <head>
  <script>

var qtyActors = 1000;
var initWealth = 100;
var qtyTransactions = 10000;
var lossFactor = .83;
var gainFactor = .2;
var actorWealthArray = new Array();
// Create the actors, an array
// Loop through an array adding elements
for (var i = 0; i < qtyActors; i++) {
  actorWealthArray[i] = initWealth;
}
// Define a transaction
function transaction() {
// pick 2 actors, actor 1 wins
var actorWinner = Math.round(Math.random()*qtyActors);
var actorLoser = Math.round(Math.random()*qtyActors);
// find the stakes
var wealth = Math.min(actorWealthArray[actorWinner], actorWealthArray[actorLoser]);
var loss = lossFactor * wealth;
var gain = gainFactor * wealth;

// transfer amounts
actorWealthArray[actorWinner] *= gainFactor;
actorWealthArray[actorLoser] *= lossFactor;
}
// Run the transactions
for (var i = 0; i < qtyTransactions; i++) {
  transaction();
}


// Output the results
  // sort the array by wealth, desc
actorWealthArray.sort(function(a, b){return b-a});
var output = "<table>";
for (var i = 0; i < actorWealthArray.length; i++) {
  output += "<tr><td>" + i + "</td><td>" + actorWealthArray[i] + "</td></tr>";
}
output += "</table>"

</script>

  </head>
  <body>
    <p id="output"></p>
<script>

document.getElementById("output").innerHTML = "Standings: " + output;
</script>
</body>
</html>
/r/Libertarian Thread Link - scientificamerican.com