PDA

View Full Version : Madden 2007 and Random Numbers


dongiovanni1976x
September 5, 2006, 04:27 PM
The following is an argument AGAINST “Hard Determinism” from a coworker of mine. I am mostly interested in hearing from forum members who specialize in Mathematical equations as this argument hinges upon the mind being programmed with a similar kind of equation that may produce random results.

In short I was playing Madden 2007, and I threw an interception. I started to get mad at myself, but then realized there is nothing I could have done to avoid it. I was predestined to throw an interception at that time in my life from the day I was born. Then later in the game I had a long 60 yard run with Steven Jackson... I broke 4 tackles within the first 10 yards, then took it for a touchdown. Naturally I was happy and ironically the rationalization that I was predestined to make that run never touched my mind. Of course when something good happened it happened because I made it happen. ;). Then later in the game I had the exact same runing play lined up and I was facing the exact same defensive formation. Again I broke my first two tackles but this time on the 3rd tackle I didn't break it. I then naturally thought it wasn't my fault I got tackled, it would happen anyway. Then I had a BREAK THROUGH. It is impossible to be predermined in anything on this game because the game works more like quantum mechanics. there are built in algorithms that produce statistical odds for a given situation. There was a computer program built to say there was a 15% chance I would break each of those tackles. Those statistical odds built into the game are at random, no way to be predestined to be anything. And to add onto that. Depending on how the odds built within the game play in my favor, may change the length of time I play the playstation game. Depending on how long I play the game depends on what happens with the rest of my life outside of the game. For example. Lets say I got really angry at the game, quit before I planned to quit, then drove my car and died in a car accident. If the playstation odds played better in my favor I may have continued playing instead of dying in a car wreck. Do you see my point?

Personally I think that the program that generates the 15% "chance" cannot generate a random number without prior input- input that in and of itself determines whether the 15% criteria is met. But I am not a math wiz so I would love to hear some mathematical examples, if there are any, that if used as a program in a robot, could generate completely random behavior.

sweetiepie
September 5, 2006, 09:53 PM
er. sorry. nothing short of qm, which madden 2007 does not use, will give you random numbers. programs use algorithms-- fairly complicated ones that derive numbers from various arbitrary events-- but such events are as determined as a flip of a coin.

TheMathGuy
September 5, 2006, 11:30 PM
Ah yes! The question of "randomness". I have often had this discussion with some of my fellow mathematicians, and the issue definitely comes up in computer science (for my bachelor's degree I double-majored in both math and computer science), hence I feel I am qualified to comment on this discussion.

First of all we need to understand how a computer actually works, and I hope this will help explain that with existing computers (assuming they do not malfunction), it is impossible to generate truly "random" numbers. As mathematician John von Neumann liked to put it, "Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin." :)

In 1936 Alan Turing conceived of a model of computation that is now known as the "Turing Machine". At the time it was merely a thought experiement, but now all of the computers currently in existence today fit the definition of being a Turing Machine. A Turing Machine consists of 4 elements:

1.) Data storage: To be more precise, we can think of this as a single "reel" or "tape" that has individual chunks that can store data. There is a finite set of symbols, called an "alphabet" which describes what can be written to each of these "chunks". For example, the simplest useful alphabet consists of exactly two different symbols and is called the "binary alphabet". It's symbols are "0" and "1". The chunks of memory where these symbols are stored are referred to as "bits". For example, the following represents a 16-bit tape of memory:
0110110111101010
Each bit stores either a "0" or a "1". In Turing's model the amount of memory is allowed to be unlimited, though in practice of course we cannot do this. However, Turing's model only allows a finite amount of memory to be used at any given time, so anything a Turing machine can do could be accomplished by a computer provided we could give it enough memory.

2.) Read/write head: A head that can read and write symbols on the tape and can move left or right by a finite amount (the original description only allowed the head to move one unit at a time, however anything that can be done with Turing Machine whose head moves by more than one unit at a time can also be accomplished by a Turing Machine whose head only moves one unit at a time--it just takes longer). So for the purposes of asking what a Turing Machine can and cannot do we can assume the head moves left or right by any finite number of units that we tell it to.

3.) States: A finite set of states that the machine can be in. For example, a lamp with multiple brightness settings could be in the states:
1) OFF
2) ON LOW
3) ON HIGH
For a typical computer of course this number of states is much much higher, but it's still only a finite number.

4.) Transition table: A lookup table (or "transition table") that represents the wiring of the machine. For each possible combination of a state the machine is in and a symbol the head is reading from the tape, this lookp table indicates three things:
1) Which symbol (from the given "alphabet"), if any, the head will be instructed to write onto the tape.
2) Where the head will be instructed to move after it is done writing (for example, "3 units left" or "7 units right". To save writing we'll use plus and minus signs where -3 will mean "go left 3 units" and +7 will mean "go right 7 units")
3) The new state the machine will be in after the head is finished doing it's thing (writing on the tape and/or moving to a different position)

Here's an example of a simple Turing Machine:
Alphabet: Binary (i.e. "0", "1")
Tape (including starting position of the head):

0000000000000000

States: S=starting state, P=another state, F="final" state
Transition table:
symbol: | 0 | 1 |
state_____|____________|____________|
__S_______|__'1',+3,P__|__'0',-1,P__|
__P_______|__'1',-2,S__|__'0',+9,F__|
__F_______|__'1',-1,F__|__'1',+0,F__|

What will happen when we start this machine up?
Here's what will happen:
S

0000000000000000

P

1000000000000000

S

1001000000000000

P

1101000000000000

S

1101100000000000

P

1111100000000000

S

1111110000000000

P

1110110000000000

F

1100110000000000

F

1100110000010000

F

1100110000110000

F

1100110001110000

F

1100110011110000

F

1100110111110000

F

1100111111110000

From this point on the machine will keep reading '1' from the tape, and being in state 'F' it will write '1' to the tape, not move the head, and stay in state 'F', and so at this point the computer is said to be "idling".

You will notice that given the starting state, the position of the head, and the data stored in memory, we can go through the operation of the computer step by step and, using the transition table, know exactly what it will do.

I think this post is getting a bit long so I'll expand some more on this topic in another post.

TheMathGuy
September 6, 2006, 01:10 AM
One common method of generating "pseudo-random" numbers is called the "linear feedback shift register". It consists of a certain fixed amount of memory, and a fixed set of inputs into the machine (positions from which to read memory). It works in two cycles. First, all the inputs are read and these numbers are then added together. Then the computer asks "Is this number odd?" If the answer is yes, it outputs a "1", and if no it outputs a "0". I've used the diamond symbol (♦) to represent this operation. In the second phase, the computer shifts the entire contents of memory one unit to the left and then takes the number it just outputted and stores it in the last slot in memory. It is then ready to compute another "random" digit. The below example shows how this might happen with a 16-bit memory, inputs on the 1st, 3rd, 4th, and 6th positions in memory, and starting with the number 0011110001011001 stored in memory:

┌─┐ ┌─┐ ┌─┐
┌─┬┬─┬─│+│─→3─→│♦│──→1 ──→ │1│
│ ││ │ └─┘ └─┘ └─┘
0011110001011001∙

┌─┐ ┌─┐
│+│ │♦│ 1
. .. . └─┘ └─┘ │
←0111100010110011←───┘

───────────────────────────────
┌─┐ ┌─┐ ┌─┐
┌─┬┬─┬─│+│─→2─→│♦│──→0 ──→ │0│
│ ││ │ └─┘ └─┘ └─┘
0111100010110011∙

┌─┐ ┌─┐
│+│ │♦│ 0
. .. . └─┘ └─┘ │
←1111000101100110←───┘

───────────────────────────────
┌─┐ ┌─┐ ┌─┐
┌─┬┬─┬─│+│─→3─→│♦│──→1 ──→ │1│
│ ││ │ └─┘ └─┘ └─┘
1111000101100110∙

┌─┐ ┌─┐
│+│ │♦│ 1
. .. . └─┘ └─┘ │
←1110001011001101←───┘

───────────────────────────────
┌─┐ ┌─┐ ┌─┐
┌─┬┬─┬─│+│─→2─→│♦│──→0 ──→ │0│
│ ││ │ └─┘ └─┘ └─┘
1110001011001101∙

┌─┐ ┌─┐
│+│ │♦│ 0
. .. . └─┘ └─┘ │
←1100010110011010←───┘

───────────────────────────────
┌─┐ ┌─┐ ┌─┐
┌─┬┬─┬─│+│─→2─→│♦│──→0 ───→ │0│
│ ││ │ └─┘ └─┘ └─┘
1100010110011010∙

┌─┐ ┌─┐
│+│ │♦│ 0
. .. . └─┘ └─┘ │
←1000101100110100←───┘

───────────────────────────────
┌─┐ ┌─┐ ┌─┐
┌─┬┬─┬─│+│─→1─→│♦│──→1 ───→ │1│
│ ││ │ └─┘ └─┘ └─┘
1000101100110100∙

┌─┐ ┌─┐
│+│ │♦│ 1
. .. . └─┘ └─┘ │
←0001011001101001←───┘

Expressing this as a Turing Machine is rather complicated, but suffice to say it is possible to do so. The "linear feedback shift register" is fast, computes a series of digits that look very random to human observers, and goes through all possible 16-digits numbers in memory (except 0000000000000000) before it repeats (so it repeats itself after 65,535 times). There are other kinds of pseudo-random number generators out there, depending on what purpose you want them to serve and what mathematical properties you prefer them to have, but all of them are Turing Machines (they have to be, since every physical computer is a Turing Machine). Hence if you know what random number generator is being used, you can work out exactly what numbers it is going to produce.

The only way a computer can possibly produce a number that can't be predicted is if it malfunctions (generally considered a bad thing!)

TheMathGuy
September 6, 2006, 01:42 AM
So lets get back to your friend's example. Your friend is being tackled, so he presses a key to try to break free of the tackle. Let's say Madden 2007 is designed to make the chances of breaking a tackle about 15%. Let's say it does this by using a pseudo-random number generator that generates integers from 1 through 4,294,967,296. If we take 15% of 4,294,967,296 it is about 644,245,094. So the pseudo-random number generator does it's thing, and then if the number it gives is less than 644,245,094 the computer program shows the football player breaking the tackle, otherwise not. However, if we know what pseudo-random number generator is being used, then we can know exactly what number it is going to produce (we can compute this number ourselves, using the input to the pseudo-random generator and the description of it's states, head position, and transition table). So if this number is less than 644,245,094 we know your friend will succeed in breaking the tackle, otherwise not.

dongiovanni1976x
September 6, 2006, 08:49 AM
So lets get back to your friend's example. Your friend is being tackled, so he presses a key to try to break free of the tackle. Let's say Madden 2007 is designed to make the chances of breaking a tackle about 15%. Let's say it does this by using a pseudo-random number generator that generates integers from 1 through 4,294,967,296. If we take 15% of 4,294,967,296 it is about 644,245,094. So the pseudo-random number generator does it's thing, and then if the number it gives is less than 644,245,094 the computer program shows the football player breaking the tackle, otherwise not. However, if we know what pseudo-random number generator is being used, then we can know exactly what number it is going to produce (we can compute this number ourselves, using the input to the pseudo-random generator and the description of it's states, head position, and transition table). So if this number is less than 644,245,094 we know your friend will succeed in breaking the tackle, otherwise not.

You should teach this stuff. That was the best explanation I have ever been given and was exactly what I was looking for- especially since I get win my argument with him!
lol
:D
Thanks again...:notworthy:

TheMathGuy
September 6, 2006, 10:39 AM
Thanks! I always enjoy this kind of discussion (part of the reason I'm studying mathematics and computer science). I should warn you that if your friend knows more about how the human brain works he could always counter that it is not a Turing Machine, and therefore the same argument does not apply to it.

I've also heard that there has been some research done into creating random-number generating machines which are not Turing Machines, since in some situations it is highly desirable to have a process which cannot be predicted (in cryptography for example). The way they work is by taking readings from a highly unstable chemical reaction which is believed to be "random". Of course all this is really doing is pushing the question back one level further. How do we really know the chemical reaction is "random"?

I can't seem to find a reference for it, but I remember hearing a story on TV about someone who noticed a pattern in the output of some electronic game at a casino (which was supposedly "random") and made off with a huge sum of money from the casino by taking advantage of it. :D

DreamBotCaptain
September 6, 2006, 11:56 AM
MathGuy is right that computers can only make pseudo-random numbers (http://en.wikipedia.org/wiki/Pseudo-random_number). However, for all practical purposes, currently, PRN's appear to be random and should be treated as such.

"Let's say it does this by using a pseudo-random number generator that generates integers from 1 through 4,294,967,296. If we take 15% of 4,294,967,296 it is about 644,245,094. So the pseudo-random number generator does it's thing, and then if the number it gives is less than 644,245,094 the computer program shows the football player breaking the tackle, otherwise not."

This is a close representation of part of what is actually happening. In actuality the max number is far higher than 4.3 billion - usually at like 2^32 - 1 or, more likely, 2^64 - 1. Current pseudo-random number (PRN) generators involve a seed that starts off a sequence of PRN's. If you know which seed will be used and how many times the PRN has iterated, you can get the exact value of the PRN at any specific time. The formula for computing PRN's isn't typically "the x-th PRN is f(x)." Its, "the next PRN after x is f(x)" or "PRN(x+1) = f(PRN(x))."

While PRN's aren't genuinely random, they do a damn good job of creating a statistical data set that would look exactly like true random numbers. Also, with more and more computing power, the max (ie. 2^64 - 1) grows and the formulas become better, which both make the PRN data set even closer to actual random data.

Chamaeleon
September 6, 2006, 05:54 PM
Why anyone would use something other than a Mersenne_twister for a random number generation is beyond me. :) A period of 2^19937 - 1 before repeating itself should be sufficient for most purposes.

Now, the case in point, I think a fairly important factor is that since a person is involved, making decisions and interacting with the program at various points in time, the number of random numbers generated could vary depending on how long the player takes to click a button or whatever. So given two systems in identical states with two different people playing, you could end up with one performing the action a bit faster or slower, possibly resulting a different outcome compared with the other player.

So if there's enough time for system A to generate 4 random numbers for whatever purpose not related to the players action, while system B only generates 3, because player B does something a tad faster, the outcome could be wildly different because the 15% probability will now not be checked against the same random number for both players.

Never mind that I have no clue whatsoever to what extent random numbers are used and how they are used in these kinds of games. Also, I tend to write too much sometimes. In person someone would probably just tell me to shut up right about now.

Cheerful Charlie
September 9, 2006, 02:09 AM
The following is an argument AGAINST “Hard Determinism” from a coworker of mine. I am mostly interested in hearing from forum members who specialize in Mathematical equations as this argument hinges upon the mind being programmed with a similar kind of equation that may produce random results.



Personally I think that the program that generates the 15% "chance" cannot generate a random number without prior input- input that in and of itself determines whether the 15% criteria is met. But I am not a math wiz so I would love to hear some mathematical examples, if there are any, that if used as a program in a robot, could generate completely random behavior.

There are a few systems that have been set up to do that. For example using timings of
key inputs to create a seed. you start with a seed that is going to be rather non-random, but
by using inputs like that you can quickly randomize things, and create random tables.


In a human mind, random input happens all the time. Someting distracts you at work, an
argument between co-workers or such. It may change your whole day.

TheMathGuy
September 9, 2006, 08:49 PM
While PRN's aren't genuinely random, they do a damn good job of creating a statistical data set that would look exactly like true random numbers. Also, with more and more computing power, the max (ie. 2^64 - 1) grows and the formulas become better, which both make the PRN data set even closer to actual random data. (Emphasis mine)

Ahh, and there's the rub! We don't know if the concept of true randomness is even a logically coherent idea. So whether such a thing exists as true randomness, or even can exist, is a question of much philosophical speculation! And hence all we can really do is propose various "tests" of randomness and see how well the proposed algorithm satisfies the tests. For example, one of the simplest and most desirable properties of "random numbers" is that of equidistribution (http://mathworld.wolfram.com/EquidistributedSequence.html).

Also Chamaeleon's point about the Mersenne twister being the random number generator of choice for most applications is correct. The reason I used the generalised feedback shift register was that it was a reasonably non-trivial example that was still relatively easy to explain to a layman. As good as it is, the Mersenne twister is still not suitable for cryptography however, for the simple reason that if someone is able to determine the exact state of the Mersenne twister at any given time, then they could set their own Mersenne twister to that state and it would output exactly the same numbers as the other Mersenne twister would (i.e. the numbers would be perfectly predictable). Given the output of the Mersenne twister, it doesn't take long before the exact state of the machine can be determined, and thus the security of the code compromised.