Profile

Cover photo
DB Fuller
174,636 views
AboutPostsPhotosYouTube

Stream

DB Fuller

Shared publicly  - 
 
Chaos explained.
1
Add a comment...

DB Fuller

commented on a video on YouTube.
Shared publicly  - 
 
I ran the simulation in Java (code bellow). I used Monte-Carlo because I wanted to get a measure of variance.

I chose k in three different ways with three different results (value in parenthesis is the 95% confidence interval half width):
    -- Choose k and use it for all matches in all replications: result is 55.56% (±0.01%)
    -- Choose k and use it for all matches of a single replication: result is 64.34% (±1.47%)
    -- Choose k every time the game is played (a match): result is 66.67% (±0.01%)

The last result matches +Joshua Mcateer 's simulation. Although I avoided picking explicit limits as he did and other posters complained. (There are implicit limits in the Java language, but they are very large and I digress...)

My question is: I felt the results shouldn't be dependent on how often I choose k at all. Is there a reason this happened? Code mistake? Poor number generator? Interesting Math phenomenon +Numberphile can explain?

#####   Code   #####

import java.util.Random;

public class Main {
    public static void main(String[] args) {
        final int n = 1000000, replicN = 100;
        double a, b, k;
        long seed = 0;
        Random r;
        int win;
        double[] resultArray = new double[replicN];
        double avg, var, halfIntConf;
        final String format = "%.2f";
        //
//        k = (new Random(1l)).nextGaussian(); //Choose k and use it for all replications: result is 55.56% (±0.01%)
        for (int replic = 0; replic < resultArray.length; replic++) {
            r = new Random(++seed);
            win = 0;
//            k = r.nextGaussian(); //Choose k and use it for this replication: result is 64.34% (±1.47%)
            for (int i = 0; i < n; i++) {
                k = r.nextGaussian(); //Choose k every time: result is 66.67% (±0.01%)
                a = r.nextGaussian();
                b = r.nextGaussian();
                if ((a < k && a < b) || (a > k && a > b)) {
                    win++;
                }
            }
            resultArray[replic] = ((double) win) / n * 100;
        }
        avg = 0;
        for (double d : resultArray) {
            avg += d;
        }
        avg /= replicN;
        var = 0;
        for (double d : resultArray) {
            var += ((d - avg) * (d - avg));
        }
        var /= replicN;
        halfIntConf = 1.96 * Math.sqrt(var / replicN);
        //
        System.out.println(
                "Win percentage = " + String.format(format, avg) + "% " +
                "(±" + String.format(format, halfIntConf) + "%)");
    }
}
1
qorilla's profile photoDB Fuller's profile photo
5 comments
 
+qorilla Ah, yes. I see your point. Excellent way to put it too.
I'm away from the program now to run it further now, but I think you are right.
Thank you!
Add a comment...

DB Fuller

commented on a video on YouTube.
Shared publicly  - 
 
I hope everybody learns this and uses this, because I'll then always pick one from the first 37% that nobody is using. ¦¬Þ
3
Add a comment...

DB Fuller

Discussion  - 
 
That double-winged car got disqualified after a protest by the team that came up with the (legal) 6-wheel car.

Talk about visible aerodynamic tweeks...

#LongBeach1982   #Ferrari   #Aerodynamics   
21
3
Silverstone Events Taxis's profile photolynus .70's profile photo
Add a comment...

DB Fuller

Shared publicly  - 
 
Despite Windows' insistence that it already had the best driver available, I manually installed the motherboard manufacturer's AHCI driver.

It feels like I have a new computer! ¦¬O

Just when I was starting to trust Windows...

#microsoft   #windows8  
1
Add a comment...

DB Fuller

Shared publicly  - 
 
The Dark Knight Returns is a brilliant story. Over 25 years old and very little better has been done.
2
Add a comment...

DB Fuller

➲ F1 Photos & Videos  - 
 
To everybody claiming F1 cannot have cars with covered wheels because they've never had them, I present you the W196 streamline.

Altough I agree they shouldn't go that way in the future.
15
John Knights's profile photoSalim Awad's profile photo
2 comments
 
They are called "open-wheel" for a reason you know... 
Add a comment...

DB Fuller

commented on a video on YouTube.
Shared publicly  - 
 
Belíssima entrevista.
 ·  Translate
1
Add a comment...

DB Fuller

commented on a video on YouTube.
Shared publicly  - 
 
Fun with flags™!
6
Add a comment...

DB Fuller

➲ Off Topic  - 
 
"In the impact, one of the suspension wishbones penetrated the safety cell."
Very scary stuff!
Fortunately he seems to be recovering.
http://www.theguardian.com/sport/2015/may/19/james-hinchcliffe-indycar-crash-indy-500-intensive-care

Edit: sorry, I quoted one article and pasted another.
http://www.racer.com/indycar/item/116939-indy-500-hinchcliffe-saved-from-serious-injuries
3
Bart Hill's profile photoWesley Branton's profile photo
3 comments
 
Noooooooooooooooooooooooooo!
Add a comment...

DB Fuller

Shared publicly  - 
 
Great details about the machine and its flaw that enabled the breaking of the code.

Links here to make it easier:
http://youtu.be/G2_Q9FoD-oQ
http://youtu.be/V4V2bpZlqx8
http://youtu.be/BdrrJ7qd4HA
 
 
Enigma Machine Video Series
by +James Grime 
(recreated due to apparent deletion)

Many people have heard of the famous Enigma Machine developed in Germany as an electro-mechanical cipher device and later picked up and made even more sophisticated by the German military forces in WWII, but how many people have seen a real one in action?

Mathematician +James Grime has an actual Enigma Machine in his possession, and in this video series he will demonstrate it, in his own charming and inimitable fashion, whilst addressing questions such as:    

How and why were the rotors set?
What was the role of the plugboard?
How come the same letter could be coded differently in the same text?
How many ways was it possible to set the Naval machine?
What procedural and design flaws created the chink in its armor?
What were the roles of Mathematicians like Alan Turing?

Videos here:
158,962,555,217,826,360,000 - Numberphile
Flaw in the Enigma Code - Numberphile
Enigma Extra Footage - Numberphile

Wikipedia: http://goo.gl/DCvUx
More on the mathematical thinking behind the code breaking.
Turing Biography: http://www.turing.org.uk/book/


Image: http://goo.gl/DO3mE
5 comments on original post
1
Add a comment...

DB Fuller

Pictures and videos  - 
 
Throw back Wednesday.

Because we are clearly not following conventions here.
12
1
Rex Broadway's profile photo
Add a comment...
Basic Information
Gender
Male
Links
YouTube
Other profiles