ByteBracket and The Sweet Sixteen

 

 

bytebracket-blog-2

No matter your metaphor, distillation is all about getting to the good stuff. Whether it’s whiskey getting triple distilled, a viral tweet link getting shortened, or the slow march of March Madness through the Round of 32, to the Sweet 16, to the Elite 8 and beyond, it’s all about something big somehow getting bigger by becoming smaller.

Now, we can’t help you with the whiskey part, but we DO have a little something for you in the way of some Twitter and March Madness magic. You may recall a post from March 15th in which we introduced something called #ByteBracket. This little bit of algorithmic magic rather took on a life of its own, and a whole lot of basketball lovers ended up vying for bragging rights with their tweetable brackets.

#ByteBracketTweet
So here now is our own Andy Brown, who has very kindly offered to show you just exactly how he created #ByteBracket! Enjoy!
~The Editors

~

You’ve spent days filling out the perfect March Madness bracket. You’ve painstakingly deliberated over every one of the 63 games in the tournament and you’re certain that you’ve correctly predicted every upset.

image03

Now you want to share your bracket. You’d love to tweet it to your followers, but how could you ever express the intricacies of your bracket in 140 characters?

It just can’t be done!

Or can it?

Meet ByteBracket

ByteBracket is a unique, compact representation of a March madness bracket. It’s a sequence of 16 letters and numbers which can completely specify any bracket. For example, it’s entirely possible that the winning bracket this year will be A7BD83321FF240D2. But for this to work, we’ll need a set of rules for converting such a sequence into an actual bracket of teams. This calls for a protocol!

How ByteBracket works

To understand how ByteBracket works, let’s first imagine a miniature version of the NCAA basketball tournament.

image02

In this 8 team version there are 7 total games and the first round has 4 games. Now, let’s say I think Teams A, D, F, and G will win their first games. Now my bracket would look like this:

image01

Now, let’s think about what actually happened in that stage. All I really did was make 4 binary decisions: for each game, I simply had to decide whether I thought the top team (the team above the line) or the bottom team would win. Now, let’s say I made the following the rule:

  • If the team above the line wins, call that a 1
  • If the team below the line wins, call that a 0

Well, in games 1 through 4, I chose above, below, below, above, which I could represent as 1001

If I then predicted team A would win G5 and team F would win G6, I would add a 1 and a 1. So now my bracket would be 100111.

Now I need a rule for who goes on top in G7. Let’s say the winning team from the left always goes on top. Now my bracket looks like this:

image00

I think team F is going to win it all. F is on the bottom, so I’m going to add another 0 to my sequence: 1001110.

Now, if there were only one tournament happening at a time, this would be enough information to fully specify my bracket. But there are two: the men’s and the women’s leagues. No problem, I’ll just make the following rule:

  • If your bracket is for the men’s league, the last character in your bracket should be a 1
  • If your bracket is for the women’s league, the last character in your bracket should be a 0

Let’s say this were my bracket for the men’s tournament. I add another 1 and now I have my full bracket 10011101.

This is great! We’ve captured all of our bracket-making decisions into a sequence of 8 1’s and 0’s. I could give this sequence to anyone who knew the rules I used and they would be able to perfectly reproduce my bracket.

Now this is pretty good, but it’s not great. 8 characters isn’t bad for this mini-tournament, but for the real, 64-team tournament this would require a sequence of 64 1’s and 0’s.

That’s too long. Let’s shorten this sequence of 1’s and 0’s.

Binary

To shorten our sequence 10011101 it’s helpful to think in terms of binary. You’re probably used to the base 10 number system where you use the digits 0-9 to represent any number you’d like. Binary is similar, except it only uses 0 and 1. Here’s a table for converting the numbers 0-15 from base ten to binary:

Base 10 Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
14 1110
15 1111

So a sequence of 4 1’s or 0’s is really just a fancy way of writing a number between 0 and 15. This will be useful! After all my bracket, 10011101, is really just two sets of four numbers: 1001 and 1101

Shortening ByteBracket with Hex

Hexadecimal (commonly known as Hex) is a base 16 number system. The numbers 0 – 9 are all represented as normal, but the numbers 10-15 are represented with the letters A through F.

Base 10 Binary Hex
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

This means that my bracket is actually just two hex numbers: 1001 is 9 and 1101 is D. My complicated selection of winners and losers can be fully represented as 9D.

The Full Tournament

The real March Madness tournament has 64 teams (and two leagues, one men and one women). This tournament would require a sequence of 64 1s and 0s. We’ve already seen how a sequence of four 1s and 0s can be represented by a single hexadecimal character, so this means the full tournament will require 16 characters (64 / 4). Now you can unambiguously tweet your incredible predictions and still have plenty of characters left to gloat!

The ByteBracket Protocol Summary

A ByteBracket string is generated as follows:

  • First, assign each game a number between 1-63 using the following rules:
    • Earlier rounds are lower numbers (so the numbers 1-32 are for round 1, 33-48 for round 2, etc…)
    • Within a round, assign numbers from top to bottom and then from left to right. (so the top left quadrant of the first round would have games 1-8, the bottom left would be 9-16, top left is 17-24 and bottom right is 25-32)
  • Go through each of the 63 games in sequential order and assign a 1 or 0 to that game. If you think the team on the top will win, assign a value of 1. If you think the team on the bottom will win, assign a value of 0.
  • You should now have a sequence of 63 1’s and 0’s. If you are filling out a men’s bracket, make the 64th character a 1. If it’s a women’s bracket, the 64th character is a zero.
  • Now break your 64 character sequence into 16 chunks of 4.
  • Convert each chunk into a hexadecimal character. You now have your ByteBracket!

If you’re interested in the technical details of the protocol and the algorithm we’re using to score brackets, check out the ByteBracket white paper and the scoring algorithm we made.

~

Whiskey, Twitter, and Basketball, anyone? 

#ByteBracket: A Tweetable Representation of Your March Madness Bracket in 16 Characters

bytebracket-blog-2

The March Madness college basketball tournament is a 641 game single elimination tournament,and every March millions of people spend hours predicting the outcomes of each of its 63 games. But until now, there hasn’t been a viable way to fit those predictions into a 140 character tweet.

Why not? After all, a bracket is nothing more than 63 binary choices, each of which can be represented by a single bit. And 63 bits can be easily encoded into a slim 16 characters.

Meet #ByteBracket, a protocol for unambiguously encoding your March Madness predictions into a sequence of 16 characters. Using the #ByteBracket Generator you can fill out your bracket, get your #ByteBracket code, and share your predictions with the world, with 124 characters left to gloat!

We’ll be publishing more articles about #ByteBracket and how it works as the tournament progresses. But round 1 begins on Thursday so for now you should visit the #ByteBracket Generator and make your own.  Our #ByteBracket is bdfdffb7d8cc9fdd. What’s your #ByteBracket?

1There are actually 68 teams in this year’s tournament but brackets typically only include the 64 who make it past the preliminary “First Four” mini-tournament.

 

My Conversation with A North-Pole Programmer

Have you ever wondered how Christmas works? I was forced to completely rethink my own ideas about the magic of Christmas after a conversation I recently had with Casey, the Chief Technical Officer of Santa’s Workshop.

My Conversation with a North-Pole Programmer

The plan was to meet over Hangout, but I got the time wrong. It’s easy to mix up meetings between time zones and Santa’s Workshop is literally in every single one of them. After solving that problem (apparently the whole workshop sets their clocks to the time of a small island in the Pacific called Kiritimati), we were finally able to chat.

Immediately after our discussion began, two things became clear: Casey was legit and Santa’s Workshop is nothing like what you think it is.

Udacity: Hi Casey, it’s great to meet you. Sorry about the mix up.

Casey: Not a problem. I forget how confusing time zones can be. That’s why we adopted the just-use-one convention.

I did some research into Kiritimati. Its nickname is “Christmas Island.” Very cute.

Not cute. Practical. The nickname is a coincidence. We use that time zone because Kiritimati is just west of the International Date Line so they’re the first place in the world to celebrate Christmas.

At the time of the interview I was hesitant to spend any of my limited time with Casey discussing anything unrelated to the workings of the shop. But Casey’s responses to my questions on time zones revealed an approach to problem solving which I wasn’t anticipating.

Why does that matter?

It just makes sense for us. We had to choose one, and since the time doesn’t really matter to us 364 days of the year, we optimized for Christmas Eve clock-reading. Believe me, when you look at the clock on Christmas Eve and see 23:59, you want to know the show’s about to start without having to do time zone math.

At this point I pause and reflect on my situation. I’m talking to an elf. She’s wearing a sweater, but there isn’t a hint of red or green on it. I survey the scene for signs of cheer but nothing is what I expect. The room has glass walls through which I see a bustling office decorated more with whiteboards and computer monitors than tinsel and mistletoe. Casey sits with good posture and speaks quickly, but slight bags under her eyes and a can of red bull reveal the job requirements of an elf in December. Her eyes perk up as I ask the next question.

I’ve got to say: I was expecting more decorations and toys. What’s up with all the computers and whiteboards?

That’s one of the two things I really wanted to talk about. I think there’s this image of an elf that most people have of some squeaky voiced guy with a green hat and a silly wooden hammer making toys at an impossibly-slow rate. And Santa’s Workshop? I guess its supposed to be all this singing and dancing or something. Singing and dancing is great, but that’s not why people become elves.

Why do people become elves?

Because some people are driven to build! For them, becoming an elf may be the right move. These days the we spend more time building… and debugging… complex systems than we do making toys. But we’ve never stopped building.

Wait. Elves can code? How did that happen?

How did it happen? I’d think you would know the answer to that. We learned to code the same way anyone learns anything. We practiced. Nothing about programming is inherently all that hard, it just takes some persistence and commitment.

Earlier you said your team builds “systems?” What do you actually build?

At this point, Casey pauses. For about thirty seconds she looks away from her monitor. There’s excitement in her eyes when they return to the camera.

You know, let me ask you something. What do you know about how Christmas works overall?

I think I know the basics. Santa keeps track of the kids. The kids send in letters to ask for presents. Then on Christmas the good kids get what they wanted. Is that still true?

More or less, yes. But have you ever thought about how all of that actually happens?

It’s the magic of Christmas, right?

Casey actually laughs out loud when I say this. It takes her a few seconds to collect herself.

I’m flattered that you call it magic. But it’s not. Well, sorta. I mean, yes, it’s magic in the sense that it is incredible that all of those things actually happen. But no, there aren’t any magic wands or spells or anything. 

So how does the magic work?

We build the magic! For example, you just told me how every year, kids around the world send their letters to the North Pole. Well, we’re a small team working here. How could less than a hundred elves even begin to read the tens of millions of letters written in different languages all on our own? Even if we had omnilingual elves reading a hundred letters an hour, that would be a full year of work right there! It’s just not practical.

Instead, our amazing data team has built a system which automatically scans each letter and converts it to text. Now, we’re not the first team to build Optical Character Recognition, but as far as I know this is the first which can handle the… penmanship issues that we have to deal with. It’s a pretty amazing system.

That’s incredible. But why not just have kids send emails to Santa?

Some do! But, well, you know how earlier even you actually thought the North Pole ran on magic? I mean, you could ask “why accept letters at all? Why not have every kid submit an array of toy : value pairs over HTTP?” Sure, it could work. But then where’s the magic? Our challenge is to build systems like these that let us continue running a scalable Christmas without losing that magic.

At this point the interview was cut short. Casey was late for something important and left abruptly. We’ll continue the conversation next week and will post the transcript as soon as it happens. Let us know if there’s anything we should ask!

How to Conduct Low Cost User Research

The best way to make an app (or any product) that your users love is by understanding your users, and that means conducting user research. While big companies like Google can afford to conduct sophisticated and expensive user research studies, basic user research can be done very cheaply.

Listen to Rich Fulcher, an Android designer and developer, as he first explains some of the ways Google conducts User Research and then discusses some of the low-cost techniques you can use to improve your products immediately.

https://youtube.com/watch?v=Lnv928kXpQI%3Flist%3DPLAwxTw4SYaPmv_X_hZbMj6xunrBtqHGDI

If you want to learn more, check out UX Design for Android Developers

Check out the course

What’s the Difference Between UI and UX?

UI and UX are misunderstood acronyms. They have completely different meanings but are often used interchangeably by well-meaning people who just don’t know the difference. But the difference is not just significant. It’s eye-opening when you know it.

UI is short for “User Interface.” In the software world, this means everything that shows up on the screen: the images, text, diagrams, and widgets as well as their color, size, and positioning.

UX stands for “User Experience.” It’s much more comprehensive than UI. It’s the entire experience a user has when they use your product! When you order something from Amazon and it comes a day early, that’s good UX. When your phone doesn’t wake you up with notifications, that’s good UX too.

In UX Design for Mobile Developers the instructors leave the software world for a more… visceral… understanding of the distinction between UI and UX. Check it out!

https://youtube.com/watch?v=MnNH6ljejKo%26source%3Duds

For more UX Design principles and best practices, check out UX Design for Mobile Developers today!

Check out the course

I’m Taking a Stance Against “The Pursuit of Lifelong Learning”

Let me explain.

First, I want to distinguish between “lifelong learning” and lifelong learning. The first is a phrase, the second a behavior. The behavior I have no problem with. It’s a prerequisite for staying relevant in a rapidly changing world.

But I’m taking a stance against the phrase. To tell me I should “pursue lifelong learning” is a fact. It’s obvious and offers me no insight. Of course I should pursue lifelong learning. I should also eat right and exercise. But how?!

I really struggled with this question in my first year of college. At that time I was not a pursuer of lifelong learning. Don’t get me wrong: I still learned. But I did it reluctantly. I learned in 12-hour sessions which ended 20 minutes before the start of an exam.

But not everyone was like me. I remember watching with envy as some of my impossibly-enlightened friends spent the night after (yes, after) the exam trying to figure out how to solve that one exam question they just couldn’t crack in the allotted time. These superhuman specimens of study baffled me. The exam was over! Why were they doing this?! At the time, I thought the answer was self-discipline. In hindsight, I see it’s even simpler.

They learned because they loved learning.

The fact that they pursued lifelong learning was true, but that behavior was a symptom of a much deeper part of their identities. They were learners. Of course they spent their time learning.

With time, I learned to love learning too. It didn’t happen overnight, but as college progressed my motivation to study became less about the grade and more about the satisfaction I felt when I discovered something new. I was becoming a lifelong learner.

Today, I’m lucky enough to work at Udacity–where taking online classes is a big part of my job–and my identity as a learner has only grown with time. Because as you learn, you build new mental structures to which you can more easily affix new learning. New learning creates new opportunities to form connections across domains that once seemed separate and these connections let you find simplicity in topics which once seemed complex. In short: as you learn more, you actually learn to learn better!

And if you love learning itself, this turns into an endless cycle. Because when you love learning, you do it. When you do it, you get better. And getting better makes you love it more. In short, a love of learning causes lifelong learning.

If you find yourself struggling to find the motivation to learn (lifelong or otherwise), consider reframing the problem. Instead of “how can I get myself to pursue lifelong learning?” try asking “how can I get myself to love learning itself?”

Neither problem is easy to solve, but the second sounds like a lot more fun.

Awards for 12 Udacious 2048 Games!

Since launching Make Your Own 2048, our 2 hour mini course on HTML and CSS basics, we’ve been unbelievably impressed with the games you’ve made while learning.

We decided to give superlative awards to some of our favorite games! (Note that these categories are completely made up and, like this course, intended to be fun.)

Want to make your own version of the game? Take the course! It’s quick and it’s meant for complete beginners. Within 30 minutes, you’ll have your own version of the game to share.


Most Intergalactic Version



Jasmine’s Star Wars 2048 is the most intergalactic version. And it’s got a hilarious “try again” message.

Most Bumpin’ Version



Make sure you turn the volume up when you play SeeKasra’s version. It’s got an incredibly catchy beat.

Most 8-Bit Version



In Egemen’s version you watch everyone’s favorite plumber increase in resolution (and weirdness of outfit).

Most Fashionable Version



Shoes. So many shoes! Combine them in Merel’s version to get more!

Most Motivational Version



By going through powers of 3 instead of 2, the numbers get bigger faster. Sometimes it’s nice when things are easy. Try out Delodephius’ version.

Most Civically Responsible Version



Combine tiles to go through the steps involved in the process of converting a bill to a law in Zachary’s version.

Most Banana-Based Version



How is Vittoria’s version so addictive!?! You’re just making new bananas! I don’t know why this version is so fun, but it is.

Most Unintentionally Sadistic Version



A + A makes B. B + B makes C. Going from A to K just feels like it should be way easier than going from 2 to 2048, but it isn’t. Be careful with this version.

Most Novel Version



Combine short books to make longer ones! This definitely makes Chelsea’s version the most novel.

Most Likely to be Accepted for All Debts Public and Private



Combine small coins. Make bigger coins. Get a bitcoin to win. Try David’s version!.

Most Fundamental Version


Start with atoms and keep combining until you get… well, you’ll have to play Tali’s version to see.

Most Likely for the Ratio of Successive Tiles to Approach the Golden Ratio


This game is interesting since–except for 1 and 1–you aren’t allowed to combine the same tile. Give David’s version a shot if you want to learn more about the mathematically beautiful Fibonacci series.

Love what you’ve seen? This is just a fraction of the games that our amazing students have made! You can find more Udacious versions of 2048 in the discussion forum thread. Or you can take the class and make your own. Beginner’s welcome!