Page 1 of 1

Posted: Mon Nov 22, 2010 7:58 pm
by thibodeaux
If you have a single-elimination tournament with N (where N is any finite, positive non-zero integer) teams, how many total games will there be?

I knew the answer for values of N that are powers of 2, but I didn't know the general answer. It's just not something that I ever thought about.

Posted: Mon Nov 22, 2010 9:03 pm
by TheCatt
It's like magic.

Posted: Mon Nov 22, 2010 9:04 pm
by thibodeaux
Yeah.

Posted: Tue Nov 23, 2010 1:15 am
by Malcolm
thibodeaux wrote:If you have a single-elimination tournament with N (where N is any finite, positive non-zero integer) teams, how many total games will there be?

I knew the answer for values of N that are powers of 2, but I didn't know the general answer. It's just not something that I ever thought about.
In general, n isn't a power of 2, people cheat the value to make it so using bye weeks or wildcard teams.

Posted: Tue Nov 23, 2010 7:51 am
by thibodeaux
Yeah, but it doesn't matter; you can do it without a power of 2.

Posted: Tue Nov 23, 2010 9:28 am
by TheCatt
Malcolm wrote:
thibodeaux wrote:If you have a single-elimination tournament with N (where N is any finite, positive non-zero integer) teams, how many total games will there be?

I knew the answer for values of N that are powers of 2, but I didn't know the general answer. It's just not something that I ever thought about.
In general, n isn't a power of 2, people cheat the value to make it so using bye weeks or wildcard teams.
It's not a cheat. It's just a fact.

Posted: Tue Nov 23, 2010 10:47 am
by Malcolm
thibodeaux wrote:Yeah, but it doesn't matter; you can do it without a power of 2.
Did you find/derive the general answer? I'm slightly curious.

Posted: Tue Nov 23, 2010 10:57 am
by TheCatt
Ummm...

Posted: Tue Nov 23, 2010 11:17 am
by thibodeaux
Malcolm wrote:
thibodeaux wrote:Yeah, but it doesn't matter; you can do it without a power of 2.
Did you find/derive the general answer? I'm slightly curious.
Yep. If you have N teams, then you need N-1 games.

You can confirm this by thinking of a tournament bracket as a binary tree. You have N leaf nodes (the teams). The games are the internal nodes. Consult wikipedia for the relationship between these two entities.

Posted: Wed Nov 24, 2010 7:01 pm
by thibodeaux
The reason I mention this is that on Monday, and then again today, I interviewed a database-engineer who did not know the answer, not even for powers of 2.

Today's guy actually did try to work through for 64 teams, and he wrote down and added up the powers of 2 from 1 to 32. While he was adding, I said to him, "you know, in binary that's all ones." Didn't help him.

Posted: Wed Nov 24, 2010 7:26 pm
by Malcolm
One of our contractors is getting let go because his SQL skills suck balls. Granted, he wasn't hired for that, he kind of got screwed into a bad position. But, come on, SQL is fucking rocket science. Dude didn't know what the "bit" data type was.

I'm not looking forward to hiring any new members for our team because our hiring process is shyte. Management seems to have solved this problem just by letting manpower dwindle and refusing to hire anyone new.




Edited By Malcolm on 1290644863

Posted: Wed Nov 24, 2010 7:41 pm
by thibodeaux
Malcolm wrote:Management seems to have solved this problem just by letting manpower dwindle and refusing to hire anyone new.
Sometimes you're actually better off that way. Everybody's busy, but at least you know they're competent (I mean, assuming it's the competent ones who are left).

Posted: Wed Nov 24, 2010 8:11 pm
by Malcolm
It's going to be a loooooooooooooooooong while before the real problem idiots are removed.

Posted: Wed Nov 24, 2010 9:13 pm
by TheCatt
The other day, I was talking with one of my fellow DB people at work, and asked him what he thought datalength(13) was in t-sql... He said "2"

Maybe he uses 3 bits to a byte.