Audio

Voices in my head: Looney Tunes

An attempt at development.

Advertisements

I have no idea what to say

Everyone who writes for a living will eventually write about writing. It’s almost a natural law. Heck, someone else has probably thought of a name for it.

So why this piece?

In my first post, I laid down certain laws. Rough guides on what I consider good writing. Take note that they’re more of a summary of whose writing I’ve read and enjoyed so far, people such as:

a) Isaac Asimov
b) Paul Graham
c) hacker/preachers from the bygone era of Usenet
d) storytelling novelty accounts on Reddit

So whatever comes out of my mental mouth will probably sound like them. But how do I write? I do something I call “channeling”, or simulating the writing style of people after reading them.

There’s this idea that Michelangelo didn’t have to be taught how to sculpt, rather he had to be taught how NOT to. And I don’t know where I heard it from. It sounds like something Paul Graham would say, but cursory Googling has planted doubts1. What I can tell you is, I’m no Michelangelo. I don’t know of anything I’d have to be wrested away from. I don’t breath mathematics, nor programming, nor actually hacking stuff. And those are just about the only things I know I ought to care about.

Maybe there’s something here. I’ve recently gotten hold of the idea that whatever stuff I deal with, it’s the singular pursuit of it that makes me giddy with excitement. It’s like I’m tickled pink not by actual things but by the methods people use to achieve them. It’s why I want to build a computing monastery before I die (which is also partly supported by my having known The Promised Land through Steven Levy’s account of the TMRC in the post-war era).

I’m also no Scott Alexander. In raw verbal skill, I’m 2-3 standard deviations from the national mean (in a country whose average IQ is a standard deviation below the global mean).

I’m no windytan, whose tinkering with digital signals is one of the purest expressions of the hacker ethic.

I’m no Linus Torvalds who was hacking away at OSs before being allowed to drink.

So who am I? And what can I do?

I’m an imperfect citizen of the Universe.

I inhabit an imperfect body which almost shat itself to death before graduating from kindergarten. This event has had ramifications I am only beginning to witness.

My toolkit is imperfect. I wield problem solving techniques like a caveman (who ought to have been rather good at what they did or else I won’t be here typing this, but you get the point). I can learn things quickly but only until I’m good enough.

I have perfect standards though, in the sense that whatever I do must be perfect for sufficiently reasonable values of perfect.

This then is the crux of the matter: I reach for the sky on insect wings.


  1. Another round of cursory Googling suggests that this is in fact a Perlisism as quoted by Peter Norvig in his most famous essay

Spelunking series: Haskell

TODO:
* Problem 7

I got 99 problems…

Ooooh boy. This is gonna be huge.

It’s 2 am in the morning and I’ve just decided to try solving the 99 Haskell Problems. I’ve tried to grok Haskell on and off for at least three times now and I still haven’t gotten as far as monads. That’s a great thing, because I’m getting fed up at not being able to code every day and Haskell is as good as it’s gonna get.

So let’s get started.

Problem 01 (2016-04-28 02:07-02:40)

The first problem is to return the tail of a list. Armed with:

ghc main.hs
./main

…I get to work. Now I haven’t seen Haskell in n years so it’s gonna take me a while to do this. Let’s see:

main = do
     print (last [1, 2, 3, 4]) -- 4
     print (last ['x','y','z']) -- 'z'

That gave me a headache. Moving on…

Problem 02 (2016-04-28 02:40-02:47)

I just found out about this:

runhaskell main.hs

…and will be using it for the remainder of this post.

Anyway, the current task is to get the penultimate element from a list. Let’s see:

main = do
     print $ last $ init [1..4] -- 3
     print $ last $ init ['a'..'z'] -- 'y'

…and we’re done.

Problem 03 (2016-04-28 02:47-02:56)

The current problem is indexing a list (starting from 1). Let’s see:

main = do
     print $ [1, 2, 3] !! (2-1) -- 2
     print $ "haskell" !! (5-1) -- 'e'

This is borderline cheating but, hey, whatever works right?

Problem 04 (2016-04-28 02:56-03:09)

Okay, let’s try and shake things up. From now on, I am restricting my use of Prelude to the following functions: map, filter, foldl’ (the non-lazy version of foldl), and foldr. Hopefully this teaches me integrity and character. The current problem is to find the length of a list. This should be easy:

main = do
     print $ (foldr (\x acc -> acc + 1) 0 [123, 456, 789]) -- 3
     print $ (foldr (\x acc -> acc + 1) 0 "Hello, world!") -- 13

My time is wasted editing things.

Problem 05 (2016-04-28 03:12-03:15)

The current problem is to reverse a list:

_reverse [] = []
_reverse (x:xs) = (_reverse xs) ++ [x]

main = do
     print $ _reverse "A man, a plan, a canal, panama!" -- "!amanap ,lanac a ,nalp a ,nam A"
     print $ _reverse [1,2,3,4] -- [4,3,2,1]

That was longer than expected. I wonder if this can be done using anonymous functions. Hmm…

EDIT (2016-04-28 03:18):

main = do
     print $ foldr (\x acc -> acc ++ [x]) [] "A man, a plan, a canal, panama!"
     print $ foldr (\x acc -> acc ++ [x]) [] [1,2,3,4]

Uses anonymous functions but a bit shorter than the original one.

I’m going to take a nap and resume this later.

Problem 06 (2016-04-29 08:27-08:31)

Slept in yesterday. Still feel like crap. Anyway, the current problem wants me to decide whether or not a given string is a palindrome:

main = do
     print $ [1,2,3] == (foldr (\x acc -> acc ++ [x]) [] [1,2,3]) -- False
     print $ "madamimadam" == (foldr (\x acc -> acc ++ [x]) [] "madamimadam") -- True
     print $ [1,2,4,8,16,8,4,2,1] == (foldr (\x acc -> acc ++ [x]) [] [1,2,4,8,16,8,4,2,1]) -- True

These lines are getting longer.

A quick aside

Haskell on Arch Linux is hell on Earth. There exists something called “cabal dependency hell” which I will neglect to explain because I don’t really understand how one of the most sophisticated group of hackers on Earth has not yet engineered a package manager that Simply Works. Lone wolf syndrome? Not qualified enough to comment on it. Nevertheless, there’s a way out of the pit and it starts when you cd into your project directory and do:

# Generates .cabal file used by cabal build
cabal init

# Initialises sandbox, installs necessary
# packages, and builds your project
cabal sandbox init
cabal install --only-dependencies
cabal build

And when you want to install a particular package in the sandbox, just do:

cabal install --require-sandbox <package-name>

Definitions

Palindrome
a word/string/list that’s the same forwards and backwards; e.g., “timtom motmit”

Hall of horrors: GearVR

TODO:
* first line of defense: reboot/replug
* second line of defense: check version
* GearVR developer mode + adb logcat *:E
* device unauthorized -> handle osig issue

The GearVR is a fantastic VR headset. It’s mobile, it’s got really good rotational tracking (in that I’ve never noticed it lag) and its screen blows away the DK2. So what’s this page for? Well, I bought SQRT(72)’s GearVR Innovator Edition for the S6 last Christmas, 2015, and did diddly-squat with it since then. Nevertheless, I’ve learned a few things about it which might prove useful to readers from the future like you.

Here I used the following:

  • Unity3D 5.3.4f1
  • Android SDK Tools 25.1.3
  • Android SDK Platform-Tools 23.1
  • GearVR Service 2.4.29
  • GearVR System 1.0.10
  • Android Marshmallow 6.0.1

Hopefully that covers everything.

In which they think they know better than to let you know what’s wrong

[insert app name here] has closed unexpectedly.

I harbor a disproportionate amount of hatred for people who do not explain what’s wrong in error messages. How difficult is it to tell you something you can Google at the very least? Anyway, to rectify this we have to do a couple of things.

One of the greatest invention of mankind is the read-print-eval loop. Having to build your project in Unity, putting the resulting .apk in your phone, putting your phone on your GearVR, then wearing it gets old pretty quick. So what we want is get out of paper-tape-land and remove the middleman. How do we do that?

  1. In your Android device, go to Settings -> Application Manager -> Gear VR Service -> Manage Storage.
  2. Tap on VR Service Version repeatedly until the Developer Mode option appears.
  3. Enable Developer Mode.

You ought to see your screen flicker. Why is this so? It seems the S6’s screen has a low-persistence mode and this option enables it amongst other things (including CPU/GPU throttling issues1). Nevertheless, you will find it wonderful that you can now deploy to your S6 directly from Unity! Just hit File -> Build & Run and (assuming you’ve got your settings down pat) it will update the app on your phone for you and launch it in stereo mode without the GearVR.

[insert adb stuff here]

In which you must sign all papers

In my short stint pushing things to the GearVR, this probably counts as the most common — and most annoying error — I have found.

Thread priority security exception. Make sure the APK is signed.

What this means is that you haven’t configured your “osig” properly. What is an “osig”, you ask?

Fig. 1: Nightmare fuel (though the background has improved).

An osig file is what you get when you put your phone’s serial number here. It’s something you have to put in your app so that you can use your GearVR with your phone. Now I don’t know what the hell Oculus was thinking when they designed this system but this osig business means you can’t show your own apps to your friends without ruffling through their phones first. Only they have the power to make your .apks run on any GearVR device. What’s up with that?


Definitions

DK2, Oculus Rift
the second Rift development kit from Oculus
GearVR
the first decent mobile VR headset by Samsung
Read-print-eval loop
an interactive I/O session with your favourite programming language
S6, Samsung Galaxy
Samsung’s flagship phone from 2015 March to 2016 February
Samsung
a South Korean tech chaebol — probably THE South Korean chaebol as of 2016-04-29
Stereo mode
the iconic fisheye splitscreen found in early recordings of VR
SQRT(72)
see A self-centered history of neo-VR

 


  1. See this post on Reddit. 

On keeping things

0. A universe from scratch

I have a wiki.

Yes, the same kind you used in high school to populate the bibliography section of your paper on 17th-century perfumery. But mine’s about — well, me — and it saves me a lot of time and effort keeping track of all the things I want to do, all the games I want to experience or the things I want to pawn off some store’s grubby shelf. We make a lot of bits just moving around by ourselves everyday and it’s a darn shame we don’t use that data as much as it should be.

Your life has more regularity in it than you think. Think about this: how do you brush your teeth? Do you brush your front teeth first or your molars? When was the last time you shuffled that order? Humans are creatures of routine but that isn’t necessarily a bad thing. The way you learn things is that an activity naturally has to take up space in your short-term memory the first few times you do it. You have to be aware of the little things, the motion of your fingers, the flow of the argument. But after doing it a few times, something called “automaticity” takes over and things become less involved. At this point you are now able to talk a bit while driving or tell a joke while playing the horrendous part of Chopin’s Minute Waltz1.

I’m a huge fan of spreadsheets so I pour as much of my life into them as possible. In my wiki I have spreadsheets for the following:

  • games I need to play before I die
  • films and series I need to see in order to become a Cultured Citizen
  • textbooks/monographs written by smart people, usually dead ones
  • books about building societies or destroying them

…and a few things that ought not be seen by the public. In fact, I’d wager the spreadsheet-to-page ratio of my wiki is very close to one.

Habits, wants, principles — all these regularities are points on our map of ourselves. And therein lies the advantage of having your life on paper: you can see your life from above. You can plan routes, mark dangerous spots, and if need be tear off a few parts to make way for new territory. Collecting data about oneself and splaying it out on a table (or in my case on scriptable, 21st-century ones) is the modern fulfillment of Socrates’ examined life 2.

But something’s amiss about my wiki. Very early on, I made the decision of using Google Sheets to power my hard-on for tabulation. This was a matter of convenience over posterity: it’s almost never a good idea to introduce external dependencies on long-term projects. And so I worry that when Don’t Be Evil falls, my entire map will slide off the table.

1. Manuals for free

Jason Scott is a modern-day hero. On the 15th of August 2015, he drove 230 miles to a warehouse to save 25 000 manuals3 from the dump. In a world where more information is generated every second than can be read in one’s lifetime [citation needed], posterity is a mere afterthought. The firehose of information that violates our tiny mouths every day is hard enough to deal with, so it’s not a surprise that only very few people are able to think about where and how to keep it.

Going completely digital is a black hole waiting to happen. Electrons can only stay in the bits of hard drives for so long and, in the flash memory that is trying to replace them, even shorter. And physical decay is not the only problem. We put our data in fragile boxes, file formats that seldom describe themselves 4. If everyone suddenly dropped dead right now, the (decidedly non-human) archaeologists of tomorrow would be flabbergasted of the civilisation that suddenly started talking in code around the same time it invented plastic.

I mentioned Jason Scott because a similar bomb dropped near me and I wasn’t able to stop it. As a part of the oldest academic organisation in University X, I had a harrowing experience trying — and failing — to save a couple of important documents from the shredder. You see, the problem with all student-run organisations I know is that they’re always a few years away from the gutter. Three or four years isn’t enough to pass on all the aspects of a culture. Unless its founders had enough foresight to put a system in place to ensure its complete transmission, it is bound to get lost, decay or otherwise morph into an unrecognisable entropic mess by the time they invite you to their homecomings.

One aspect of Organisation X that has survived the second law of thermodynamics is the keeping of almost-verbatim meeting notes in log books. It’s the job of the secretary to record every nook and cranny of discussions during assemblies. We had a cabinet of such records up to the 80’s and it contained, amongst various doodles and runaway calculations, a record of who votes what on which issues. And what can you use that information for? That’s right. Making lists of your members throughout the years.

So what happened to those logbooks? Well, every first Monday of the month, Organisation X requires its members to reduce the entropy of its club room. In University X, Mondays mean lab class so I had to fidget in a dark room for three hours straight while they were forming dead skin cells into mounds. An observation was made that the cabinet used by the people who get to decide on matters of membership was almost full due in great part to the presence of a couple of cough-inducing notebooks. A quick round of discussion later and those notebooks were put on a bus to the wonderful land of Your Local Scrapyard.

I had plans for those notebooks. I was going to hack a makeshift scanner and learn how to digitise an analog corpus. It would have been a fun project for the school break. But no. I must have made a few CO2 particles near-luminal because I heard loud and angry explosions behind me. When I arrived at the scrapyard, it was too late: the shredder had won and the annals of Organisation X was headed to the mills to become some sweaty old man’s porn mag.


Definitions

Automaticity
the phenomenon where doing something repeatedly makes you have to think less in order to do it
Cultured Citizen
you know what this means
Don’t Be Evil
Google’s official motto
Jason Scott
archivist who’s part of the venerable archive.org
Organisation X
the only school organisation I legitimately joined in college
University X
the university I went to

 

 


  1. Not a pianist but Chopin is famous for being difficult. 
  2. Don’t take my word on this. Take Wikiquote’s
  3. This post, from the man himself. 
  4. There has been some progress on this front in the form of PDF/A, NetCDF, and HDF5 (sans how monolithic it appears). 

A self-centered history of neo-VR

TODO:
 * write part about
  * magazine interview
  * morning talkshow interview
  * noontime news interview
  * The Great Depression: coffeeshop meeting + Chibot
  * The Emperor's New Clothes in PUP
  * Manila Vive Jam: pre-event
  * Manila Vive Jam: hackathon
  * The semester of departed quantities (i.e., when I disappeared for a bit)
  * Blue Eagle startup competition comeback
  * Space Pirate Trainer and the EEE demo
  * GearVR Workshops
  * The Philippine Mobile VR Jam

 On the 9th of May 2015

…my stomach was grumbling.

Thirty-one people, plus or minus twenty, had just been assaulted by funky-looking boxes and I still hadn’t gotten myself a slice of that goddamn pizza.

I removed myself from the GTX 970-powered terminal in front of me and waited to get a word in edgewise with a particularly candid personality. Let’s call him SQRT(72). I stood there, anxious to shake hands with a person I should have met a year before then. On the head of the person he’s talking to was a GearVR:

Fig. 1: The Samsung GearVR Innovator Edition. Credits to Katie Collins 1.

The GearVR came out with nary a moment of calm, particularly because Midas (i.e., John Carmack) himself gave it a personal touch.

[insert brief GearVR history here]

So there I was, talking to SQRT(72) about all the fun things we could have done if we had met each other offline sooner. SQRT(72) and I met on Reddit with two other folks, whom we shall call The Non-Orbiting Rodent and Pomade Power. Let me tell you a few things about them:

  • SQRT(72) is the most financially astute businessguy I know. He’s the sort of person who would count the scratches on his phone so he can sell it near its original price later on. Plus he’s a Virtual Boy and Apple II veteran.
  • TNOR (for short) was the first one to nab a DK2 in the Philippines. Accordingly, he claims to have demoed the darned thing at ToyConPH 2014 to “around 300 people”.
  • Pomade Power is the only actual game dev in our ragtag. He’s also the first one to have put on the PSVR, which I still haven’t tried as of this writing (2016-04-05).

These folks and I comprise Pinoy Rifters, one of the earliest neo-VR groups in the Philippines.

So where were me and SQRT(72) on that 9th of May? We were attending this event:

Fig. 2: VR/AR Manila Meetup. Sorry for the compression artifacts.

VR Philippines asked to borrow my DK1 and I happily obliged. I wasn’t prepared for the barrage of demoees, however, since before the meetup I’ve demoed my DK1 to perhaps less than ten people. Little did I know it was an omen of things yet to come.

A nexus of sorts

I liked the atmosphere of that first meetup so much I joined its organisers. VR Philippines was the brainchild of people whom we shall call Will It Blender (WIB) and Chromolungma (Chromo). Back then, they were really the only ones actually doing things at VRPH. I figured they were a decent set of folks so I took the plunge with them. We met a few times at CBTL to talk about what we’re doing and where we’re headed. One of the things that came out of those conversations was the idea of becoming a nexus.

Here’s the thing: people remember only the firsts and the bests. We certainly weren’t the first, so we were left with no choice. VRPH had to become the center of activity of VR/AR in this country or else we will become dust in the wind. It was an incisive existential point that takes a bit of neuroticism to come up with: after all, you don’t take the driver’s seat if you trust in others’ ability to drive.

So what exactly does becoming a nexus entail? For starters, Chromo and I share a decent amount of aesthetic sense. And that sense is a constant ringing that tells us to keep looking for a coherent style we can call our own, kind of like how the French have their own way of making films. Being at the center of it all allows us to follow certain kinds of content and promote them according to our own tastes.

It also carries another important advantage: it keeps us in the loop. If you’re the center of everyone’s conversation, then you’re bound to hear about everything. In a race as fast as this one, a four-month hiatus is the same as being in the sidelines.

We’re not the only ones in this race, however. On the 25th of July 2015, the Asia-Pacific Virtual Network held a synchronised meetup spanning eight cities from Istanbul to Brisbane.

Alien blue, or how to sell VR on TV

Our local version was well-attended, with over 100 folks having come and went. It’s interesting to note that even this early on in our timeline, game studios here such as Synergy88 were already trying to get their grips on VR. I am Cardboard (the folks who sell those elegant black Cardboards) was also there, as was Narra3D (a co-founder of which will become important later on in our story). But the most interesting project shown then was from a person we shall call The Shopkeeper. The Shopkeeper is a stout fellow with deep green eyes and he was the reason Chromo and WIB met in real life. He brought with him a pair of haptic gloves, something that no one else in the country seemed to be doing at the time. This is an interesting point because electronics here is cheap. Manufacturing anything here, from wood to plastic to metal is dirt cheap compared to other countries. So why the dearth of hardware projects?

I don’t know why that is but I think it also has something to do with white-collar jobs being the default choice of almost everyone. Here, anyone with half-decent schooling wants a desk job with bosses to please while the rest are either left to tinker with cars or washing machines or are busy cooking themselves to death in a gimmicky pop-up restaurant.

Anyway, The Shopkeeper was put on the spot by a group of journalists and reporters from national TV. However, his prototype was still very rough and the IMUs and servos were yet to come. So when it was time to shoot a reel of the gloves, the hostess of the show (i.e., the trope-namer of this section) had no choice but to fake it, which I think was quite unfair to The Shopkeeper.

Fig. 3: Alien Blue, which upon further inspection turns out to have been black. Also shown is an I Am Cardboard headset. Credits to VR Philippines[2].

Fig. 4: The Shopkeeper’s NeoHaptic Gloves, one real, one digital.

The Great Depression

Chromo, WIB, and I went home in a taxi with HMDs and hulking PCs in tow. In our CBTL meetings, we promised ourselves an event at least as big as the APVRN meetup every quarter.

I had other ideas for VRPH (in fact, it’s my job to have other ideas for VRPH). People here have to make things, not just try them on. In fact, I recall Chromo having a rather heated exchange with someone about the fact that we didn’t restrict our VR showcase at the APVRN meetup to local content. How the hell were we going to do that if the vast majority of local content back then were 40-minute Unity3D prototypes that look and run like your dog hooking up with a tree? I think it’s high time I misquote Hermann Weyl here:

“We have always tried to unite what works with what was made here, but when we had to choose one or the other, we usually chose what works.”

Not saying his/her game was shitty though. In fact, it was one of the better games out there. Perhaps he/she was just mind-projecting that everyone else must have approached their game with the same guile he/she had shown.

After APVRN, we were invited to a STEM fair in UP Los Baños. I don’t have a story to tell you because I wasn’t there, but I do know two things:

First is that a person whom we shall call The Giving Tree was a student in UP Los Baños then. This, coupled with the fact that he was one of the most active members of the group, led to him being roped into helping Chromo and WIB during the STEM fair. Second is this:

Fig. 5: Queing VR.

Everyone and their mother loves children. Because of the overwhelmingly positive response of kids to being shown VR in Cardboard and the DK1, we were invited to TV segment which I’ll talk about later.

 


Definitions

APVRN
Asia-Pacific Virtual Reality Network
DK1
Oculus Rift DK1; the headset that started it all (or neo-VR, at least)
DK2
Oculus Rift DK2; the first neo-VR headset to have proper positional tracking
CBTL
The Coffee Bean & Tea Leaf; the de facto VRPH meet up venue
Chibot
Delfin Joseph Baylon, organiser at VR Philippines; 3D artist extraordinaire
Chromo
Chromolungma/Cristopher David, co-founder of VR Philippines; so named for his excellent colour sense and his quirky username (which I shall omit for privacy reasons)
Giving Tree, The
Adrian Vincent Tayag, organiser at VR Philippines; so named because he has given more demos to people than anyone in VRPH
Haptic gloves
gloves which allow you to touch and feel objects in-game
Mind projection fallacy
when you confuse what you think with what there is
MTBS3D
Meant to be Seen 3D, a message board on stereoscopic 3D gaming and VR that’s dead to most of the neo-VR community
Neo-VR
the history of VR starting from the moment John Carmack noticed Palmer Luckey’s VR headset prototypes on the MTBS3D forums
Pinoy Rifters
one of the oldest neo-VR groups in the Philippines
Pomade Power
Matthew Valeriano, CTO at Figment Games and moustache enthusiast
SQRT(72)
Rene Canlas, master of everything that computes at Pointwest Technologies and hardcore early adopter
Shopkeeper, The
Guido Stercken, founder of NeoHaptic
TNOR
The Non-Orbiting Rodent/Lance Ong, first DK2 owner in the Philippines
Unity3D
the most indie-friendly game engine back then
VRPH
VR Philippines
WIB
Will It Blender/Gabriel Enriquez, co-founder of VR Philippines; so named for his Blender skills and iron will

1. From Wired Magazine.

Things I don’t understand: Bayes’ theorem

TODO:
* clean up the discussion about conditional probability
* put in footnotes
* make Fig. 1

In which I lay down foundations

Probability is interesting to me for two reasons:

  • It’s useful.
  • It’s a generalisation of logic1.

The problem is, I have never had any formal training in it. Not even in high school. So that leaves me in a bit of a limbo because I see understanding probability as one of the cornerstones of Good Thinking.

This is my attempt at curing that.

What I shall do is start from the axioms then prove theorems as I tackle classic problems. Which means three things: a) this page will be a work-in-progress indefinitely2, b) the vocabulary I will build here may not correspond to the standard one, and c) I’ll probably get things wrong a lot of times so this may not be the best page to cite in support of your Internet argument.

Before we start, I’d like to introduce a rule and a notion. I won’t start from the very foundations of mathematics because that will just waste everyone’s time. But I really admire the rigor of the Bourbaki school (in great part because I’m still in my “rigorous phase”3). So I shall follow a simple rule: every assertion must have a proof or a reference to one. And to do that more efficiently I’ll borrow a notion from programming and “import” complete mathematical objects in this manner:

IPT 1: (the algebra of sets)
see Wikipedia

Eventually, those external links should become internal ones.

Right. Let’s get to work. Here are some definitions:

DEF: (data point)
a value (e.g., “red”, “42.4 seconds”)
DEF: (data set)
a set of data points
DEF: (universe, the Universal Data Set)
\Omega, or the data set containing all data sets
DEF: (probability)
the probability P(E) of a data set E is a real number associated with E

These are the basic building blocks of probability theory.

As far as I know, probability theory is then completely axiomatised by the following three axioms (which come from A. Kolmogorov, according to Wikipedia):

AXM 1: (“All probabilities are non-zero.”)
(\forall S \subseteq \Omega)(P(S) \geq 0)
AXM 2: (“The probability of the Universal Data Set is 1.”)
P(\Omega) = 1
AXM 3: (“The probabilities of disjoint data sets are additive.”)
(\forall E_1, E_2 \subseteq \Omega)( (E_1 \cap E_2 = \emptyset) => (P(E_1 \cup E_2) = P(E_1) + P(E_2)) )

Using these we can already say a few basic facts about probabilities.

THM 1: “The probability of the empty set is 0.”
(P(\emptyset) = 0)
\begin{aligned} &\rightsquigarrow \emptyset \cap \Omega = \emptyset \\ &\implies P(\emptyset \cup \Omega) = P(\Omega) = P(\emptyset) + P(\Omega) \\ &\implies P(\emptyset) = 0\\ &\Box \\ \end{aligned}

 

THM 2: “The probability of the complement of a data set is one (1) minus the probability of the original.”
(P(A^c) = 1 - P(A))
\begin{aligned} &\rightsquigarrow A \cap A^c = \emptyset \\ &\implies P(A \cup A^c) = P(\Omega) = 1 = P(A) + P(A^c)\\ &\implies P(A^c) = 1 - P(A) \\ &\Box \\ \end{aligned}

(Can I just say how awful and tedious it is to write multi-line \LaTeX in default WordPress?)

What we have though is still too bare. It lacks flavour. So let’s define a few more things:

DEF: (reduced universe)
the reduced universe \Omega_E of a data set E is the subset of the universe \Omega where E is true
DEF: (joint probability)
the probability P(A \cap B), or the probability of both A and B being true
DEF: (conditional probability)
the probability P(A|B) = \frac{P(A \cap B)}{P(B)}, or the probability of A being true given that B is true
DEF: (independence)
two data sets are independent if P(A \cap B) = P(A)P(B)

What are these definitions for?

  • We defined the reduced universe as such because we want to be able to say, “In the universe where data set A is true…”.
  • What do we mean by a data set being true in the first place? Say A = \{\text{Alice is a big mouse.}\}. Then in a particular universe, A is true if Alice is a mouse and if she is big and not otherwise. The truthiness of A is the truthiness of all its conditions.
  • Why the definition of conditional probability? We want to have a way of saying, “The truth of A depends on the truth of B by this much.” […]
  • In this vein, saying that two data sets are independent is saying that whether or not B is true does not affect whether or not A is true: P(A \cap B) = P(A)P(B) \implies P(A|B) = \frac{P(A \cap B)}{P(B)} = \frac{P(A)P(B)}{P(B)} = P(A).

[…]

Fig. 1: A versus \not A


Definitions

Good Thinking
following what works; see the Twelve Virtues of Rationality, particularly the twelfth virtue

1. E. T. Jaynes. “Probability: The Logic of Science.” 1995. Print.

2. See the About section of gwern.net.

3. See Terry Tao’s post.