Live data from Hacker News

What does randomness look like?

empiricalzeal.com

81–90 of 123 posts

Re: What does randomness look like?

#81
post #48

Earlier quoted context omitted.

Oh yes. Our intuition is that random is fair and uniform, but it's absolutely not. I was bit by another random quirk in World of Warcraft. There was a long-running achievement called "What a Strange Long Journey it has Been", which took at least a year in real-time to complete, and you had to actively play during each of the ten or so in-game festivals and holidays, and do some quests and tasks during each. If you mi…

> Oh yes. Our intuition is that random is fair and uniform, but it's absolutely not. But a uniform distribution is random, isn't it? This sort of phrasing is rampant in this thread, and I'm confused by it. How can a uniform distribution be considered non-random, or "less" random than another distribution?

If you had bothered to read the article, your questions would have been answered.

Re: What does randomness look like?

#82
post #69

You can try it out yourself in your browser. This scriptlet generates random and non-random dot distributions side by side (refreshing regenerates, at least in Firefox 17): javascript:" foo foo var canvas = document.getElementById('tutorial');var ctx = canvas.getContext('2d');ctx.fillStyle = \"rgb(000,0,0)\";for (var i=0;i var canvas = document.getElementById('tutorial2');var ctx = canvas.getContext('2d');ctx.fillSty…

Here’s a web page displaying those dot distributions plus a more readable version of that code: http://bl.ocks.org/4358325.

Re: What does randomness look like?

#83
post #48

Earlier quoted context omitted.

Oh yes. Our intuition is that random is fair and uniform, but it's absolutely not. I was bit by another random quirk in World of Warcraft. There was a long-running achievement called "What a Strange Long Journey it has Been", which took at least a year in real-time to complete, and you had to actively play during each of the ten or so in-game festivals and holidays, and do some quests and tasks during each. If you mi…

> Oh yes. Our intuition is that random is fair and uniform, but it's absolutely not. But a uniform distribution is random, isn't it? This sort of phrasing is rampant in this thread, and I'm confused by it. How can a uniform distribution be considered non-random, or "less" random than another distribution?

Randomness is about having a uniform probability of results, but that does not translate into a uniform distribution of results, nor can it, because of the de-correlation between random results. Specifically, the chance of getting the same result multiple times is non-zero, and actually can be fairly high with a lot of samples, whereas the chance of duplicate results in a uniform distribution is zero.

Read the article for more details and examples.

Re: What does randomness look like?

#84

Here's a weird thing about randomness that has always bothered me: In quantum mechanics, if you measure two incompatible observables (like position and momentum) of a system, and then repeat that experiment many times, you will get two lists of real numbers. QM says you can predict the distribution of these numbers, but you cannot predict the individual numbers themselves. The popular way of thinking nowadays is that…

Yes, that is the thing: Bell's inequality has been verified experimentally and that leads to a non-hidden variables reality (for the usual meaning of 'reality'):

http://en.wikipedia.org/wiki/Bell%27s_theorem

Re: What does randomness look like?

#85

Earlier quoted context omitted.

> This reminds me of Magic: the Gathering and the misery of mana screw. Incidentally, apparently people complain about the online versions of the game providing a land distribution that's "too even". Also, while mana screw sucks, between the fact that you can decide whether or not to begin with a certain opening hand and the fact that you can design your deck around such circumstances (mana fixing, proper distributio…

Incidentally, apparently people complain about the online versions of the game providing a land distribution that's "too even". Online bridge has a similar problem. Four riffle shuffles (which does not fully randomize hands) is typical in bridge games, and this means that long suits (and, thus, better hands) are more common. Early online bridge games randomized hands fully and therefore delivered crappier (flatter) h…

> Early online bridge games randomized hands fully and therefore delivered crappier (flatter) hands than people were typically used to.

Are you saying that all online bridge games today do not fully randomize the shuffle, but simulate riffle shuffles instead?

Re: What does randomness look like?

#87

Back in the day I was in a raiding guild in World of Warcraft. And back then, each boss monster in a raid dungeon had a loot table, and when you killed it, your raid got a few pieces of random loot. And I don't know how many times I, and the other guy in the guild who understood statistics, had to explain to the others that random doesn't mean uniform. If a certain piece of armour has a 1/X chance to drop from a boss…

Yeah, And you know, it is always possible in those situations that there is a broken pseudo-random number generator involved. But of course, that's really hard to tell too because real randomness is so unrandom seeming.

Another Blizzard game, Diablo 2, actually had a random number generator bug that went unnoticed for years.

Essentially, any random chance in the game of the form 1 to n could only ever be 1 to n-1, I think with n-1 being twice as likely.

This went unnoticed since most random rolls were over fairly large ranges and it didn't seem to hurt much, however it did explain why one particular subtype of loot literally never dropped.

Re: What does randomness look like?

#88
As a side note this is one of those things that several tetris-clones deal have to deal with, long runs are probable but can frustrate a player so a lot of the times you want to to extra logic to keep it from being actually random.

A uniform "deck" a couple times larger than the number of pieces is the usual suggestion prevents large runs and makes sure that you see every piece more regularly.

Re: What does randomness look like?

#89
Python script I wrote a while back that outputs random images. PIL must be installed to work. Change |file_name| accordingly. JPEG images can be up to 65535 x 65535 in size, which are the max values for |width| and |height|. It's not optimized, so keep the resolution small unless you want to wait a while.

It'll output images that look like this: http://dave-gallagher.net/pics/666x666.png

    from PIL import Image, ImageDraw
    from random import randint
    
    def random_image():
        
        width       = 666
        height      = 666
        file_name   = '/Users/Dave/%dx%d' % (width, height)
        path_png    = file_name + '.png'
        path_jpg    = file_name + '.jpg'
        path_bmp    = file_name + '.bmp'
        path_tif    = file_name + '.tif'
        
        img  = Image.new("RGB", (width, height), "#FFFFFF")
        draw = ImageDraw.Draw(img)
        
        for height_pixel in range(height):
            if height_pixel % 100 is 0:
                print height_pixel
            
            for width_pixel in range(width):
                r  = randint(0, 255)
                g  = randint(0, 255)
                b  = randint(0, 255)
                
                dr = (randint(0, 255) - r) / 300.0
                dg = (randint(0, 255) - g) / 300.0
                db = (randint(0, 255) - b) / 300.0
                
                r  = r + dr
                g  = g + dg
                b  = b + db
                
                draw.line((width_pixel, height_pixel, width_pixel, height_pixel), fill=(int(r), int(g), int(b)))
            
        img.save(fp=path_png, format="PNG")
        img.save(fp=path_jpg, format="JPEG", quality=95, subsampling=0)     # 100 quality is 2x to 3x file size, but you won't see a difference visually.
        img.save(fp=path_bmp, format="BMP")
        img.save(fp=path_tif, format="TIFF")
    
    
    if __name__ == "__main__":
        random_image()

Re: What does randomness look like?

#90
post #9

Very interesting! So, the basic point being made is that if you know that a set of events are random and independent and you know their mean value, then you can predict their spread? (or aggregation) edit: Hmm...another question that comes to mind: is the converse true? If the spread of values of these events do not match the poisson distribution, then can we presume them to be nonrandom? Or nonindependent? Or both?

If you have enough data and to determine the distribution and it's characteristics (eg mean and s.d. for normal etc) then you can use it to predict spread.
Post reply on HN