Showing posts with label Mathematics. Show all posts
Showing posts with label Mathematics. Show all posts

Wednesday, May 18, 2016

Numbers


This has been a thought in my head since round about 1979; I've never sat down to write it, though I have remembered it from time to time.  I remembered it yesterday - and though it isn't new, as I just today found the same observation elsewhere on the net, I'm going to go ahead and write this anyway. Call it fan service.  The post below is based loosely on an essay by Isaac Asimov (but the conclusions are mine).

A 'number system' is a means of expressing calculations based upon the number of symbols used, in order to produce natural numbers - numbers used for counting.  We use what's call the 'decimal' number system, or base 10, in which ten symbols are employed: 0, 1, 2, 3 and so on.  The binary number system only uses two symbols, 0 and 1.

So let's take a number, say "54."  We don't normally think of it this way but the structure of the number represents two columns: the "5" is in the first column and the "4" is in the second column. Express in scientific notation, the first column equals 5 x 101 while the second column equals 4 x 10 to the zero power (100).  Anything to the zero power is equal to 1.  Feel free to read further on exponents on Wikipedia if you so desire.

Let's say you want to multiply 18 by 3.  If you weren't doing this though the use of a tool, you would start by multiply 3 by 8.  You would then divide the product by by 10, putting down a "2" in the 101 column and a "4" in the 100 column.  Then you would multiply 3 by 1 - and since the "1" is already in the 101 column you would again divide by 10 and add the product, "3", to that column:


Simple stuff.

The principle is the same with a 2-based number system, only then the columns are based on 20, 21, 22, 23, 24, 25 and so on.  In ten-based numbers this translates to 1, 2, 4, 8, 16, 32 and so on.  Written in 2-based numbers, however, this is 1, 10, 100, 1000, 10000 and 100000.  Each column outwards from the right represents an exponent of 2.

If we want to translate "54" into a 2-based system we would begin by dividing 54 by 32 (1 with a remainder of 22), then dividing 22 by 16 (1 with a remainder of 6), then dividing 6 by 4 (1 with a remainder of 2) and finally dividing 2 by 2 (with  no remainder).  We don't need the "8" column (23) and we don't need the "1" column (20).  Let me express the number using the same sort of table as above:


This is old hat for a lot of you - but believe it or not, some people have never stumbled across this before.  Others took this in school but never really got it, you know?  Some people aren't getting it now, but  - well, we do our best.

So 54 expressed in a binary number system equals "110110."

Very well.  Let's try multiplying six times nine in a 13-based number system.  We typically think of 6 x 9 as "54;" but in a 13 based number system, the columns are 131 and 130, or "13" and "1."

Therefore, we start by dividing 54 by 13, not 10; this gives us 4 with a remainder of 2.  The 2 then fits into the 13column, so our product is 42.  9 x 6 = 42.

This was pointed out to Douglas Adams, who answered, "I may be a sorry case, but I don't write jokes in base 13."  Pity.  This is the sort of thing that comes back to bite writers in the ass.  We sit at our desk, stare into the garden and concoct a number - and then it turns out somewhere down the line that the number means something.

Personally, I choose to disregard Adams' explanation.  Obviously, the number did not come into his head at random.  It was placed there by a 13-fingered God who was trying to send a message to the modern world.  The universe may not fundamentally make any sense, as Arthur Dent noted, but it isn't because 9 x 6 doesn't add up to 42.  It is because God has more fingers on one hand than he has on the other.  God is a freak.  God is an outcast among his own people, creating this world in order to assuage his deep-seated need for both affection and total obedience.  He is a shallow, hurting, abused boy stuck in his room, afraid to go out where he will be taunted and ridiculed, so instead he hides and haphazardly mis-fashions a world (his left hand, the Left Hand of God, has the extra finger and winds up fucking up everything the right hand tries to build) while we remain blissfully unaware of this all-too-important defect.

And millions of Adams' fans missed it.  Perhaps the greatest theological proof in the universe and people missed it!

God must be so pissed.

Tuesday, June 10, 2014

Vast Numbers

From Malcolm Gladwell's David and Goliath: Underdogs, Misfits, and the Art of Battling Giants, giving a typical example of a teacher speaking about class size:

"My perfect number is 18 [students in a classroom].  That's enough bodies in a room that no one person needs to feel vulnerable, but everyone can feel important.  18 divides handily into groups of 2 or 3 or 6, all varying degrees of intimacy in and of themselves.  With 18 students, I can always get to each one of them when I need to.  24 is my second favourite number.  The extra six bodies make it even more likely that there will be a dissident among them, a rebel or two to challenge the status quo.  But the trade off with 24 is that it verges on having the energetic mass of an audience instead of a team.  Add six more of them to hit 30 bodies and we've weakened the energetic connections so far that even the most charismatic of teachers can't maintain the 'magic' all the time.  And what about the other direction?  Drop down six from the typical 18 bodies and we have the Last Supper, and that's the problem.  12 is small enough to fit around the holiday dinner table - too intimate for many high schoolers to protect their autonomy on the days when they need to, and too easily dominated by the bombast or bully - either of whom could be the teacher herself.  By the time we shrink to six bodies, there is no place to hide at all, and not enough diversity in thought or experience to add the richness that can come from numbers."

In context, Gladwell is discussing that class sizes have been statistically proven (read the book before you disagree) to have no influence whatsoever on a student's ability to succeed in school, whereas of course teachers have preferences that have much to do with what teachers want.  I want to use the passage, however, to highlight those two things that I've put into bold.  The situation that bullies dominate, and where the players lack enough diversity in experience.

Sunday I included an excerpt from the book about emergent behaviour that I don't think I'm going to expand.  I'm don't feel that I am required to go through and point out sentences that people feel were not important enough to read or assimilate in order to understand the point - I put the sentence there and I assume the reader will read IT as well as all the other sentences in the passage.

The sentence I refer to is this:  "To produce synthesis of this kind requires a vast number of interactions . . ."  Vast.  As in, more than the reader can comprehend.  Since I had several people, good and bad, express a misunderstanding about what the word vast means, who feel that 'emergent behaviour' can result from the dialogue of players around the table, I thought perhaps I would try to give a little better explanation here.  For the book itself, it doesn't specifically matter. The passage is there to convey information to people who are somewhat 'up' on the mathematics. For those people who are not 'up,' the passage can sit in the corner like an old shoe until the day the reader comes back to it again with greater understanding.

Look at the passage from teachers again.  Six children are not enough to produce diversity.  There's a number of reasons for this.  First, if there are only six, they are probably very homogeneous in upbringing and culture.  Remember, it took 24 for it to be likely that there's a 'rebel' in the group.  Six children also have a lot of power to influence or dominate each other, as there's no place to escape.  This means that the bully in 12 children is 665,280 times as powerful among only six.  I can prove that mathematically.  Among 12 students (factorial 12!) the number of possible connections between those students is 479,001,600.  Among six students (factorial 6!) the number of possible connections is only 720.  Don't pretend that this isn't the case.  This is a reality of permutations, like God not being able to make a triangle with three sides that add up to anything other than 180 degrees.  [Alexis is wrong in parts here]

The amount of influence that a strong child - or adult - has among a group of six people is incredible compared to the amount of power that same individual has in a larger classroom.  This means that among six children, or the five players of your game + you, if there is one person who's personality is even a little bit stronger than the others, the others are going to follow that strong personality.  That is something you need to be accept.

This also means that, regarding 'emergent behaviour' is concerned, the large proportion of individual, unique moments - far, far too many of the possible random elements - are going to be skewed by that individual pushing or pulling everyone else in one direction.  There won't be enough kinetic energy in the system, there will be too many interactions that will produce null effects, and a critical mass of aberrant behaviour won't be reached.  Not remotely in your dreams.  If you think otherwise, you're not reading the above with a clear head, you don't understand enough about math or people, and you really ought to finish your education before weighing in.

Now let's look at numbers.  Let's start with the most popular example of all time where it comes to talking about the vastness of numbers and the likelihood of emergent behaviour.  Let's talk about cards.

You have a deck of 52 cards.  From this deck, in a truly random fashion, you decide to draw two cards. Let's say, you get first get an 8 of clubs and then a 3 of diamonds.  You put the cards back.  You shuffle the deck.  The deck is truly shuffled.  The deck exists in a universe where there are no flaws on the cards that would make any one card physically different from another card.  What are your chances of once again drawing an 8 of clubs and a 3 of diamonds in the same order?

The answer:  52!  (The exclamation point is not there for emphasis.  The '!' indicates 52 factorial). [Turns out, Alexis has his head up his ass for a lot of this post's math.  Please disregard, and see the comment from Giordanisti below]

In ordinary numbers, 52! = 8.0658175 x 10 to the 67th power.  How many is that?  Well, in round figures, if you wrote each possible combination in very small print onto a hydrogen atom (assuming that were possible), then you would have to write the possibilities on enough hydrogen atoms to make a small galaxy.

And now we are talking about numbers vast enough to produce emergent behaviour.  Humans interacting with each other just doesn't amount to beans.  If all the atoms of all the objects and persons at the gaming table could break apart and interact with each other, then yes, we would have enough big numbers.  But that's not what's happening.

The dice, on the other hand, like cards, are producing incomprehensibly vast random associations without our having any awareness that this happening - because numbers as big as these are just beyond our ability to cope.  That is why, thankfully, we have math to cope for us.

I continue to be astounded by people who think that math isn't important.  Or that math is the last thing that should be used to describe or explain something, or that somehow the power of the will can be used to prove that math isn't the master of all things.  Even as I write this post, there are wholly ignorant readers who are shaking their heads, thinking that I've somehow pulled a fast one, or invented a straw man, because they're damned resistant against any idea that mere numbers could control everything they do or see. They sit here on this internet and spit on the math and spreadsheets I make for my world and yet they just don't get it.

They sit on the internet.

The internet.

And pooh pooh math.

That is an amazing demonstration of sheer stupidity.

I'm going to end this post with a favourite quote from Robert A. Heinlein, that appeared in Time Enough for Love:

"Anyone who cannot cope with mathematics is not fully human.  At best, he is a tolerable subhuman who has learned to wear his shoes, bathe, and not make messes in the house."

UPDATE:

It occurs to me just now, a few hours after writing the above post, that there is a way of demonstrating this difference between player personalities and their effects upon possible behaviours as compared to the dice.

Try an experiment.  Sit down with your players and have them fight out a combat where no dice are thrown. Instead, tell your players that each round, they should just "go with their gut" on whether or not they hit. Then, when it comes around to the monster's turn, as the DM the reader should do the same.

Having done it once, whatever the result, set everything back to the start and have the players do it again. Take note of any differences.  Try it a third time.  Now a fourth.  How long will it be before you start to see that things are becoming very boring and silly and repetitive, as certain players either predictably change things up or predictably go with the same decisions as before.

Now, have the combat with dice.  Then have the combat again, with dice.  Take note of any difference. Take particular note of how the DICE, and the players reacting to the dice, force unpredictable behaviours from your players.

This is the difference.  This is why player decisions do not produce emergent behaviour, whereas the dice do.