Pictures of the Purdue Grand Prix.
Update: Some of you may have noticed that the panorama was stitched together wrong. It's fixed now.
Pictures of the Purdue Grand Prix.
Update: Some of you may have noticed that the panorama was stitched together wrong. It's fixed now.
Super Mario World 2: Yoshi's Island on the SNES has an interesting roulette bonus game.
The rules are simple: the player bets between one and one less than his or her total number of lives and presses a button to set the two wheels spinning. He or she then presses the button again and the wheels slowly spin down to plus or multiply on the left and zero, one, two, or three on the right. The player wins the number of lives in the expression formed from the bet, the operator on the left wheel, and the value on the right wheel.
I was curious how many lives the user could expect to win in this game, and because I'm taking a statistics course this semester, I had the power to satisfy this curiousity. What follows is an explanation of the calculation I performed and its surprising results:
There are 6 multiplies and 8 additions on the left wheel. On the right, there are 7 zeroes, 4 ones, 2 twos, and 1 three. I'm assuming that all values on either wheel are equally likely. Let W be the amount won.
Because there are two possible values on the right wheel and four on the left, it is obvious that there are 2 * 4 = 8 possible outcomes:
One can easily see that:
and:
From these basic probabilities, one can calculate the probabilities of all possible outcomes:
The expected value is defined as the sum of each value times the probability of getting that value. Basically, we take each outcome from part one and multiply it by its corresponding probability from part two to find the weighted average:
E(W) =
sum(Wi * P(Wi)) =
W1 * P(W1) + W2 * P(W2) + W3 * P(W3) + W4 * P(W4) + W5 * P(W5) + W6 * P(W6) + W7 * P(W7) + W8 * P(W8) =
(2/7)(bet + 0) + (8/49)(bet + 1) + (4/49)(bet + 2) + (2/49)(bet + 3) + (3/14)(bet * 0) + (6/49)(bet * 1) + (3/49)(bet * 2) + (3/98)(bet * 3) =
(89/98) * bet + 22/49
In the long run, the player can expect to win an average of (89/98) * bet + 22/49 lives on each spin.
It surprised me to find that this game doesn't always favor the player. On large bets, the player can expect to lose lives in the long run. For example, if I continually bet 10 lives, I could only expect to win an average of 9.5 lives on each spin. Conversely, if I were to bet only two lives, I could expect to win an average of 2.25 lives. I found it even more surprising that the player can expect the most return, about an additional .35 lives, by betting the minimum one life on each spin. That's a good deal.
Why winnings decreases as the bet increases becomes obvious when we try to calculate the gain rather than the winnings. We'll define the gain G to be the amount above the bet that the player wins. So, we can calculate the expected gain as follows:
E(G) =
E(W) - bet =
(89/98) * bet + 22/49 - bet =
-(9/98) * bet + 22/49
The expected gain is downward-sloping, so as the bet increases, gain decreases.
By setting the expected gain equal to zero, we can determine the point above which the player can expect to lose lives.
E(G) = 0
-(9/98) * bet + 22/49 = 0
bet = -(22/49) * -(98/9)
bet ~ 4.9
This tells us that the player can bet up to four lives and expect to gain lives in the long run. Above that, at a bet of five or more, the player can expect to lose lives.
It makes me wonder if Nintendo planned it that way to help the struggling players but hold back the greedy ones.
I finished the Big Semester Project for my CS class Tuesday night. We had to build a buffered IO system consisting of a simple file table and our own versions of getc, putc, and flush. Of course we weren't allowed to use the real getc and putc functions; we could only use the open, read, write, and close system calls. Part one of the project was easy because we did it all in C. For the second part, we used the file handling code from the first part, but rewrote getc, putc, and flush in SPARC assembly. It was interesting and, thankfully, not as soul-wrenchingly terrible as I fully expected it would be.
It's strange, but this semester I have had only two programming projects, neither of which I found particularly hard. I was thinking about this when I realized I haven't done any fun programming for a long time, either. Sure I've done some website maintenance, but that hardly counts. I want to create something interesting and useful for the fun of it.
I think Marc may have helped prompt this feeling. He's told me about two of his personal projects he's had going in the background this semester.
One is a PHP/MySQL database app that stores information about creatures, areas, and items he's found in a MMORPG called Horizons. The app is still in development, but he has already uploaded 79 monsters, most with pictures, descriptions, and cross references to the 93 areas where they reside. He also plans to add the hundreds of items, spells, and quests on top of all that. Impressive. I'll be sure to link to it when it goes live.
Marc's second project is a Java application for his father's investment business. His father wants to use it to calculate the most efficient investment portfolio for a client's desired risk and return. The program first plots a handful of basic portfolios containing, say, all bonds or all stocks. Then, by combining these portfolios in various ways using some incredibly complex matrix math invented by a guy named Markowitz, it calculates and plots the most efficient frontier of all possible portfolios. The user can then drag the mouse along the frontier, and the program draws a nifty little pie graph showing how much of each type of investment that particular portfolio contains. I was impressed when he showed it to me; it's a nice little program.
So then what will my next project be? That's the question I've been pondering for the past few days. My first idea was to write an IM chatbot that could act as like an interactive away message. People would IM me, and the bot would answer questions like where I was or what I was doing. It would be fun to write, but it's been done before and with more creativity.
Then I started thinking about programming something for my Palm, but I haven't hit upon a good idea of what yet. Perhaps a class assignment app. It would have a simple interface with a dropdown menu of classes, a space to write in a description of the assignment, and a date field. It would display the outstanding assignments in on a simple list that would echo the built-in todo list. If I wanted to go even further, I could add grade tracking and test reminders, but even with that addition it seems awfully mundane.
Instead of writing something of my own from the ground up, I also thought about contributing to an open source project. I don't have the faintest idea of what I would do, but writing for an OSS project would certainly propel me into a whole new level of geekdom.
None of those ideas have really struck me, though. They don't seem to have that spark that would really make people sit up and say, "Now that's cool."Anyone out there have any ideas?
Tonight the dorm is having a little spring festival in the field out back. They'll have the required food and inflatable bouncy things, as well as a band. In an amazing small-world coincidence, the band they chose is fronted by Max Allen, the guy who got third in the music contest I played in two years ago (and who I also saw at the jazz festival that following summer). He and his band were setting up when I got back from class, so I shook his hand and bought a CD. I'm listening to it now, and it's really amazing blues and jazz. He has some MP3s on his site, so check them out.
It's depressing, but meeting him reminded me that I haven't touched my guitar in weeks and I haven't composed any new music since last semester. I need to get working on that.
As some of you may know, my left leg is my "bad" leg with the ankle transplant and stainless steel plate. My right leg is my "worse" leg with the titanium knee joint. The knee bothers me from time to time, but nothing like what sprung up last night. As I laid down to sleep, I felt a terrible throbbing pain extending from below my hip all the way to the ankle. No matter what I did, I couldn't get comfortable, and the pain kept me up all night. This morning I went to the student health center to get it checked out.
As I expected, the doctor didn't find anything spectacularly obvious after poking, flexing, and x-raying the leg. She ended up giving me some anti-inflammatory drugs and sending me on my way. If the pain lasts more than a few days I'll make a quick trip back home to have my orthopaedic surgeon take a look at it.
Anyway, none of that is important. It's all just backstory to how I got these cool pictures:
This is a front view of my lower femur. Near the top you can see how the bone has regrown around the upper part of the titanium joint. I think it looks like candle wax. At the bottom you can see knee joint itself.
This is a front view of both knees. Here you can see the titanium hinge very clearly and the hole in the upper tibia where it sits. In the good knee, note the weird (and completely harmless) bone growth above and to the right of the joint. Sue thinks it makes the bone look like a guitar.
This is the coolest picture. You can see the true shape of the implant as well as the strange stuff they did to the knee cap.
A front and side view of the lower leg.
This picture is looking down at the top of the knees. It really shows the difference between the natural knee cap and the "bionic" one.
I find it amazing what the doctors were able to do. I am continually thankful that I am able to walk across campus normally thanks to effective cancer treatments and all that hardware.
If you found these pictures interesting, you'll enjoy this virtual knee surgery.
Someone tried to get me to join pyramid scheme last Tuesday. The offer came from Chad (not his real name), a smart computer engineer I've known since high school and the last person I'd expect to fall for a blatant scam.
He called around 10 PM while I was working on some homework. He said he had met with an old friend of his and that this friend had a nifty business opportunity that I would be interested in. Thinking that someone needed a website designed or some quick programming done, I went up a few floors to meet with them. That's where things started to smell a bit:
"Hi there," said the young, khakied and polo shirted guy, "It's good to meet you, Brett. Chad has told me a lot about you."
"Well that's good, I suppose," I said while sitting down in the folding chair across from Chad and the khaki fellow. "So what made you call me? Are you looking to hire for a job or are you recruiting for your company?"
"Neither, Brett. I was just telling Chad here about a unique business opportunity and he mentioned you might be interested in it as well. We're looking for sharp individuals who are driven to make it. If you don't like our offer, that's cool. Just say so and we will stop wasting your time. On the other hand, if it does appeal to you, we can go on to the next step right away. So tell me, Brett, how would you like to make an extra $2,000 while at school?"
By then alarm bells started going off. Conversations that jump right to the temptation of money can't be good. "Well that would be nice, but it'd depend on what I'd have to do for the $2,000," I said warily.
"Take Chad here. He is going to start his own business. In a few weeks he will take a trip to our business success seminar to meet millionaire after millionaire. Isn't that right, Chad?"
"Yup!" He said smiling brightly.
"Hmm... So you sell businesses?" I asked.
"We'll wait until my business partner shows up before getting into the specifics."
"Ah. Do you have a business card?"
"Yeah I think so... Let me find it." He began rooting through his bag and pockets, eventually handing me a worn and wrinkled card with his name (Douglas), a clipart compass logo, and the words "Private Franchising" below the company name.
"So do you have a website?" I asked.
"Um... nope." he replied.
By then I knew something was certainly amiss. Douglas' "business partner", another young guy in khakis, had arrived, so I decided to sit it out and see exactly what was going on. We went to the floor lounge for the full presentation.
Content aside, those guys were amazing presenters. It was absolutely beautiful business doublespeak: they said they would cut out middlemen by making their clients middlemen; they said their clients make money selling products online while they themselves made money recruiting and by selling their "business services"; they said people can buy everything online while citing Walmart, a traditional bricks-and-mortar merchant, as their primary example to emulate.
After I got past all the contradictory statements, I learned that both presenters worked for or contracted with (it's not exactly clear which) a company called Quixtar. It didn't take long for me to get fed up with the presentation. I had my suspicions and it didn't take long to confirm them back in my dorm.
Quixtar is basically Amway, updated for the internet. The way it works is this: the individual business owners like Chad do their best to sell items online using Quixtar to distribute and deliver the goods. The sellers get a (small) cut of whatever they manage to sell. Meanwhile, Quixtar sells kits and admission to seminars meant to help the business owners improve their businesses. Then people like Douglas recruit additional business owners and take a cut of whatever the new recruits make. It is the perfect example of a company based on multi-level marketing, i.e. a pyramid scheme.
I find it amazing that Chad, a smart, internet-savvy college student got taken in so easily. I called him up soon after I left and gave him some of the information I had found. His voice told the story; he had gotten tempted by the promise of money. I told him to get out of the deal as fast as he could and tell Douglas that it was despicable to try and fleece college students. I hope no one else fell for it.
I spoke to my counselor today about switching majors. I've been thinking about it a long time, and I came to the conclusion that computers just aren't in my future. So, instead of Brett Daniel, computer scientist, you may now call me Sparky Robinson, forestry major (with a minor in zoology). I'll get outside more, probably meet more girls (they love the outdoorsy types (certainly more than pale computer geeks)), and with any luck, get a summer job canoeing down the Colorado river. Right now, I think I'll go cancel my housing plan and pitch a tent in the woods to the south of campus.
I also have a new pet coyote.