Election Reaction: Day 2

Ugh.
So.

I had Trump’s victory speech on mute last night because I was trying not to flip out, but apparently it wasn’t the awful “I’m your dictator now, burn Hillary, burn the immigrants, launch nukes at Australia because an Aussie called me a bad name in a Tweet” type of speech that I was expecting.

And I know it’s not much, and I know it probably means absolutely nothing in the long run, but for now, I’m going to cling to that as a possible beacon of hope that this presidency isn’t going to be the train wreck that we all suspect.

Edit: NOPE nope NOPE nope NOPE nope NOPE nope NOPE nope NOPE nope NOPE nope

What the hell did we just do?

An accurate representation of what I was like as this calamity of a Presidential election unfolded:

Seriously though. I honestly didn’t think Trump had a chance in hell, and now it’s like 2 AM and he’s giving his little victory speech and I’m literally shaking.

What the hell is wrong with the United States?

(Sorry I don’t have more of a reaction. I’m just…shocked.)

Christmas List Party Fun Time 2K16

Note: no one has to get me any of this stuff. This is just stuff I’ve found that I think is cool.

Go!

Leibniz print! Too bad they don’t have wall-sized ones.

The hologram backpack is back in stock!

Butterfly scarf!

I STILL LOVE THESE HEADPHONES

 

Dolly-Os

Well this is pretty entertaining.

Sorry, I’m bored.

“What happened to the stairs?!”

Hahaha, this makes me super happy and nostalgic.

Sorry, I’ve been having a really crappy day and this made things a little bit better.

Plot Whole

HI AGAIN.

So remember a few days ago when I blogged about NaNoWriMo and mentioned that I’d update that post with a plot summary?
Well, I’ve got absolutely nothing of interest to say today, so I’ll just post that plot as today’s blog.

Because I can.

Okay. So the world my story is set in is exactly the same as our world now, except everyone knows and accepts that ghosts are real and exist among the living. In fact, everyone can see ghosts, but when a person able to see them and what types of ghosts they’re able to see depends on how close the person is to his or her own death.

It’s like this: ghosts are classed into one of ten types, depending on how “old” they are (that is, how long the ghost has been a ghost) and the properties that they have. Ghosts range from Ghostlets, which are the “just dead” ones who still resemble the people they were when they were alive and are super clumsy and awkward because they’re not used to being ghosts yet, to White Lights, which are the oldest known ghosts and have the job of ushering people through the final stages of death (which is why many people who survive a near-death experience say that they saw a white or bright light). The closer a person gets to their own death, the more types of these ghosts they’re able to see. People start with seeing Ghostlets and progress from there.

While ghosts and humans get along (in most cases), the government has decided that it’s a good idea to keep humans and ghosts separate as far as living spaces go. This is the job of the Bureau of the Dying and Deceased. Many of the people in this Bureau basically act like realtors for ghosts, ushering them to dwellings that are unoccupied by humans.

My main character, Nick (named, of course, after my awesome friend Nick who seems to have dropped of the earth. Hi, Nick, if you ever read this!), is an employee at the Bureau. He goes around making sure that ghosts have proper living spaces and remain out of the living spaces of humans. Of course, he can only work with the types of ghosts he can see—which, at the beginning of the story, are just the three “youngest” types.

However, Nick notices that his ability to see older and older ghosts is progressing very rapidly for someone his age, which suggests that he is quickly approaching his own death. While the progression differs from person to person (e.g., one person might be “stuck” seeing a certain type of ghost for a much longer period of time than another person), he knows that his own progression is abnormally fast. So he spends most of the story trying to figure out what might be causing him to progress so quickly towards his own death. He knows he can’t stop the progression, but he at least wants to see if he can slow it. A lot of this involves Nick talking to ghosts of various ages/types to try to figure out what’s going on with himself.

Haha, it sounds so dumb when I write it out like that. But I’m having fun with it so far.

SPRING 2017 UI SCHEDULE, BITCHES

Yo.

So it’s time for that semi-annual joy of joys event: making a fake UI schedule for the upcoming semester.
Because even when I’m no longer in school, I’m always in school in my mind.

Let’s do it!

M/W/F
PEB 106: Road & Trail Running (8:00 – 9:15)
CS 210: Programming Languages (9:30 – 10:20)
STAT 504: Introduction to Bayesian Statistics (10:30 – 11:20)
MATH 536: Probability Theory (11:30 – 12:20)
PLSC 205: General Botany (1:30 – 2:20)
MATH 476: Combinatorics (3:30 – 4:20)

T/H
PLSC 205: General Botany Lab (9:30 – 12:20 T)
MUSA 121: Concert Band (12:30 – 1:45)
GEOG 401: Climatology (2:00 – 3:15)

This is a few more credits than you’re allowed per semester, but since when did I ever pay attention to that even when I was actually in school?

THE BIG YELLOW ONE IS THE SUN

Holy crap, that was the most insane baseball game! Even if you’re not a huge baseball fan (or a baseball fan at all), hopefully you got to watch at least the last game of the World Series.

Edit: If you missed it…

Ridiculous. Awesome. I’m so glad Nate and I turned on the game after Cleveland tied it (we were going to wait and watch it later, because that’s what we were doing with all the playoff/World Series games).

Yay Cubs!

NANOSTART

Heyyyyyyyy, it’s that time of the year again: NaNoWriMo!

So I’m not currently super confident about my idea, but that might mainly be due to the fact that it was what I wanted to do last year, but ended up not even getting started on it due to extraneous circumstances (read: school). That gave me a year to kind of mull it over in my head, which usually leads to making the idea worse rather than better. So that’s a bit terrifying. I prefer to be, in the terminology of NaNo, a “pantser.”

So we’ll see how it goes. I’ll update this with a plot at some point.

Do-do-do-DOOOOOOOOO! ART!

Yay.

DIVVY UP THE BALLS

Oh my god, that piccolo clarinet. Super cute. That’s what I needed when I was nine years old and my fingers were too stubby to cover the C hole on a regular clarinet.

(teehee i said ‘c hole’)

Bookmark-A-Thon

So like a week ago I was going through my bookmarks and found that I still had freearcade.com on there. Well, today I have absolutely nothing exciting to say (what else is new?), so I guess I’ll just give you some of my favorite bookmarks.

750 Words: A website that encourages you to write 750 words a day.

Acme Klein Bottle: get Klein bottles of any size here!

CBC Music Streams: streaming music from CBC, organized by genre. Only available in Canada, though.

DeepLeap: random letters are given to you and you need to make words out of them.

Doll Divine: do you like dress-up games? I do, haha. Here’s a ton of them.

Metronome Online: for my musically-inclined readers.

PatrickJMT: math tutorials!

Powder Game: have fun with all sorts of powder powers.

RSOE EDIS: live disaster updates from all over the world.

Visual Formal Logic: understand formal logic with Venn diagrams.

TTSReader: text-to-speech!

 

Bah. Garbage blogger is garbage.

NaNoIDunno

NANOWRIMO STARTS IN FOUR DAYS

I HAVE ZERO IDEAS

AHHHHHHHHHHHHSLDFJSLDFSAFL;HFLKSDF

(Quality blog post.)

Twitter, you goon.

Why’d you have to go and murder Vine, Twitter?

WHY DID YOU HAVE TO KILL THE ONE THING RELATED TO YOU THAT I LOVE?

Screw you.

Have some Vines.

 

 

Edit:

(I laughed for like 20 minutes at this one)

Deriving the Negative Binomial Probability Mass Function

Today is going to kind of be a continuation off of yesterday’s post about the binomial. Today, however, we’re going to focus on the negative binomial and how you can derive the formula for the negative binomial from the binomial itself. Let’s do this with an example:

Scenario: A recent poll has suggested that 64% of Canadians will be spending money – decorations, Halloween treats, etc. – to celebrate Halloween this year. What is the probability that the 13th  Canadian random chosen is the 6th to say they will be spending money to celebrate Halloween?

Solving it the Binomial Way
This sounds like a binomial-type question, right? So your first thought might be as follows:

“I need to have a total of 6 ‘successes’ out of a total of 13 people asked. So n = 13, p = 0.64, and I’m looking for P(X = 6). I can apply the binomial formula like this:”

This is how we applied the binomial formula in a similar problem yesterday. But if you look closer at this question specifically, this isn’t quite asking for something that we’ve seen the binomial used for. The above binomial calculation works if you need a total of 6 successes from 13 trials and it doesn’t matter in which order they came.

This question, though, is stating that that 13th trial needs to be one of the successes—more specifically, it needs to be the 6th one. So how can we approach that?

Let’s divide the problem into two easier-to-solve parts. Based on the question, we know that the 13th trial needs to be a success. So ignore it for a second. If we ignore the 13th trial, we’re also ignoring the 6th success.

So what we’re left with is 12 trials and 5 successes.

The question doesn’t say anything about these 12 trials other than that 5 of them have to be successes. This allows us to use the binomial formula to figure out the probability that 5 of the 12 are successes: n = 12, p = 0.64, and we’re looking for P(X = 5):

That takes care of the first 12 trials. Let’s go back to the 13th one. We know, from the question, that the 13th one needs to be a success. We can find this easily: since it’s just one trial, and we know the trials are all independent and all have the same probability of success, the probability of this 13th trial being a success is just equal to 0.64, our probability of success.

Now we’ve got the two parts: the first 12 trials and the 13th trial. So how do we put this together to find the answer to the question? As I just mentioned, all the trials are all independent, so we can just multiply their probabilities:

There’s your answer!

Solving it the Negative Binomial Way
The negative binomial probability model is generally used to answer the question, “what is the probability that it will take me n trials to get s successes?”

Let n = the number of trials and s = the number of successes. To find P(X = n), or the probability that you’ll need n trials to get to a specified s number of successes, you find the following:

Let’s plug in our values from our question, which is asking for P(X = 13), so n = 13 and s = 6:

If we break up that 0.646 into (0.645)(0.641), you’ll notice that this equation is exactly the same as the one we used when solving this the binomial way.

This part was from our first 12 trials, this part was from our 13th trial and knowing it was a success. So if you solve this the binomial way, you actually are solving it using the negative binomial equation!

Deriving the Binomial Probability Mass Function

Today I want to talk about binomial random variables. Specifically, I want to talk about how you can “derive” the binomial probability mass function (pmf) using a simple example.

I want to discuss these things in a way that someone who is completely unfamiliar with statistics can understand them, so let’s start from the beginning!

  1. What is a binomial random variable?
  2. What is a probability mass function?
  3. What is the probability mass function for a binomial random variable?
  4. How can you “derive” this probability mass function from a simple example?

 

  1. What is a binomial random variable?

You can think of a binomial random variable as something that counts how often a particular event occurs in a fixed number of trials. In order for a variable to be a binomial random variable, the following conditions must be met:

  • Each trial must be performed the same way and must be independent of one another
  • In each trial, the event of interest either occurs (a “success”) or does not (a “failure”) (in other words, there must be a binary outcome in each trial)
  • There are a fixed number, n, of these trials
  • In each of the n trials, the probability of a success, p, is the same.

Here are some good “basic” examples of binomial random variables:

  • Define a “success” as getting a “heads” on a coin flip. If you flip 10 coins and let X be the number of heads you get from those 10 flips, X is a binomial random variable (n = 10, p = 0.5)
  • Define a “success” as rolling a 5 on a 6-sided die. If you roll a die 20 times and let X be the number of times you roll a 5, then X is a binomial random variable (n = 20, p = 1/6)
  • The probability of any given person being left-handed is 0.15. If you randomly ask 50 people if they are left-handed or not, and let X be the number of people who are left-handed out of the 50, then X is a binomial random variable (n = 50, p = 0.15).

As you can see, there are really two values we need to know in order to define something as a binomial random variable (which, in reality, is defining the shape of the binomial distribution from which that random variable comes): n, the number of trials, and p, the number of successes. If X is a binomial random variable, we can express this as X~binom(n,p). This is read as “X follows a binomial distribution with n trials and a probability of success p.” In our previous three examples, we could express the X’s as follows:

  • X~binom(10,0.5)
  • X~binom(20,1/6)
  • X~binom(50,0.15)
  1. What is a probability mass function?

A probability mass function (pmf) is a lot less scary than it sounds. It is simply a function that gives the probability that a (discrete) random variable is exactly equal to some value. For example, suppose X is our random variable. Let x represent a specific value that X could assume. A pmf for X could give us P(X = x), or the probability that X is equal to that specific value x.

  1. What is the probability mass function for a binomial random variable?

Let X be a binomial random variable. To find the probability that X equals a specific value x, we use the following formula:

where n is the number of trials, p is the probability of success, and

  1. How can you “derive” this probability mass function from a simple example?

This pmf might look a little complicated. However, we can understand it and how it comes about by looking at a simple example and “working backwards” to get to the above pmf formula. So let’s do it!

Suppose you roll a fair die four times. Let X be the number of times you roll a 1. You want to find the probability of rolling exactly three 1s.

In this example, the number of trials is the number of rolls. So n = 4. The probability of success is the probability of rolling a 1 on any given roll. So p = 1/6. And what we want to find is the probability that exactly three of the four rolls will result in a success. So we want P(X = 3).

Let’s see if we can figure this out without the formula.

We want the probability of getting exactly three successes out of the four rolls, or P(three successes). Another way of stating this is that we want P(success and success and success and failure), or that we want three successes and one failure. Don’t worry about the order yet; we’ll deal with that later.

So. We know that the probability of success on any one roll is 1/6, which means that the probability of failure on any one roll is 5/6. We also know that the rolls are independent of one another, as the outcome of one roll does not affect the outcome of another (e.g., rolling  a 5 on the first roll will not affect the outcome of the second roll).

Because of this independence, our calculation of P(success and success and success and failure) is just going to be the probabilities of each of the four outcomes multiplied by each other, or

In our example, this is

Notice that this is the

part of the pmf formula when x = 3 and n = 4. This is the part that gives us the probability of three successes out of four trials. However, we’re not done yet! We also need to take into account the fact that these three successes and one failure can happen in different orders. Specifically, if we denote a success as “S” and a failure as “F,” these can occur in the following orders:

SSSF
SSFS
SFSS
FSSS

That is, there are four different ways we can get three successes and one failure when n = 4. So what we need to do now is combine this with our previous calculation above to get

That 4 is actually the number of combinations of three successes and one failure we can get when n = 4. Another way we could calculate this without writing out all the possible combinations? Use this formula:

Specifically:

Our final calculation, then, is

So the probability of rolling exactly three 1s out of four rolls is 0.01543, and we can see that in our process of figuring this out, we’ve actually “derived” our binomial formula of

Cool, huh?

Well, they WERE two doctors (yeah, I know, stupid joke)

This is super coolio.

This Week’s (Month’s?) Science Blog: Sun Block

Yo.

So as you all know, I find the sun to be very awesome. Here’s a video of a guy demonstrating that despite the fact that the sun seems so huge in our sky a lot of the time, that hugeness is an illusion! The sun is, in fact, only about half a degree in size in our sky.

Supah cool.

FreeArcade Fire

I just realized that I still have freearcade.com in my bookmarks. Did you guys ever use freearcade.com? When I took typing in 7th grade, one dude in there would always visit there after he was done with his daily work (luckily our teacher was cool with this). He got us all addicted to it and we’d all work as fast as possible in order to get as much arcade time per day as we could.

My favorites:

  • Fill It
  • Wiz 3
  • Javanoid (we were OBSESSED with this, holy crap)
  • Pixie

Party time.

SASSY ASS PARTY

Q: Where do you go after your steak at Outback Steakhouse?
A: To the outhouse to get your steak back!

Like I said, I’m here all week.

Another Quality Blog Post by Claudia

Q: What is the only acceptable way for a person to praise a production of A Streetcar Named Desire?
A: Go out in the street and scream, “STELLAR!!! STELLAR!!!”

I’m here all week, people.

When I was Done Blogging

Woah.

So I downloaded this song last year, apparently, but I guess I never really gave it much of a listen (every once and awhile my daily song is one that’s just borderline something I like, and thus rarely gets played). But I happened to stumble upon this music video for it, which has completely reinvigorated my love for the song itself (and makes me wish I could animate like these guys can).

Very cool.

Yo Dawg I Herd U Like Yo Dawgs

So we put a Yo Dawg in your yo-yo so you can Yo Dawg while you yo-yo, Yo Dawg.

(This blog has no purpose.)

Edit: GOD FUCKING DAMMIT 9GAG THIS IS THE SECOND IMAGE THAT COMES UP WHEN YOU IMAGE SEARCH “YO DAWG.”

I CAME UP WITH THIS JOKE AND NO ONE ELSE SLDFJALDJLSAFJSAKFJALKDFJ

(This blog now has negative purpose.)

Week 42: Goodman and Kruskal’s Gamma

Let’s keep going with measures of correlation and talk about Goodman and Kruskal’s gamma today!

When Would You Use It?
Goodman and Kruskal’s gamma is a nonparametric test used to determine, in the population represented by a sample, if the correlation between subjects’ scores on two variables is some value other than zero.

What Type of Data?
Goodman and Kruskal’s gamma requires both variables to be ordinal data.

Test Assumptions
No assumptions listed.

Test Process
Step 1: Formulate the null and alternative hypotheses. The null hypothesis claims that in the population, the correlation between the scores on variable X and variable Y is equal to zero. The alternative hypothesis claims otherwise (that the correlation is less than, greater than, or simply not equal to zero).

Step 2: Compute the test statistic, a z-value. To do so, Goodman and Kruskal’s gamma, G, must be computed first. The following steps must be employed:

  1. Arrange the data into an ordered r x c contingency table, with r representing the number of levels of the X variable and c representing the number of levels in the Y variable. The first row represents the category that is lowest in magnitude on the X variable and the first column represents the category that is lowest in magnitude on the Y variable. Within each cell of the table is the number of subjects whose categorization on the X and Y variables corresponds to the row and column of the specified cell.
  2. Calculate nc, the number of pairs of subjects who are concordant with respect to the ordering of their scores on the two variables. This is done as follows, starting at the upper left-hand corner of the table: for each cell, determine the frequency of that cell, then multiply that frequency by the sum of all the frequencies of all cells that fall both below it and to the right of it. The sum of these products is nc.
  3. Calculate nd, the number of pairs of subjects who are discordant with respect to the ordering of their scores on the two variables. This is done as follows, starting at the upper right-hand corner of the table: for each cell, determine the frequency of that cell, then multiply that frequency by the sum of all the frequencies of all cells that fall both below it and to the left of it. The sum of these products is nd.
  4. Compute G as follows:

The test statistic itself is calculated as:

Where N is the total number of subjects whose scores are recorded in the contingency table.

Step 3: Obtain the p-value associated with the calculated z-score. The p-value indicates the probability of observing a correlation as extreme or more extreme than the observed sample correlation, under the assumption that the null hypothesis is true.

Step 4: Determine the conclusion. If the p-value is larger than the prespecified α-level, fail to reject the null hypothesis (that is, retain the claim that the correlation in the population is zero). If the p-value is smaller than the prespecified α-level, reject the null hypothesis in favor of the alternative.

Example
Let’s see if there’s a relationship between stars (3, 4, or 5) and what I consider to be my favorite four genres: electronic, pop, alternative, and rock (in that order). Let X be the song’s genre and let Y be the number of stars received by the song. The following is an ordered contingency table of a sample of 400 songs (100 of each genre).

I suspect a positive correlation between ranked favorite genres and stars. Here, n = 400 and let α = 0.05.

H0: γ = 0
Ha: γ > 0

The calculations for nc and nd:

And G and the test statistic:

Since our calculated p-value is smaller than our α-level, we reject H0 and conclude that the correlation in the population is significantly greater than zero.

Ye Olde Arte

I’m bored. Have some garbage art from my past, because why not.