Ze Ace's Tech Spot

Thursday, January 11, 2007

A perfect random number generator

A lot of computer security folk spend their time trying to generate truly random numbers. Most random numbers in a computer are just a really complex math equation run multiple times. The results look random, but if you know the equation you can guess the next number by doing nothing more than running the equation again.

Random numbers are used all the time to generate keys to keep things secret. Obviously banks and other businesses can't have keys that people can easily guess by stealing an equation. Modern cryptographers have added all sorts of tricks to make their number more random. They can measure how fast you type and add it to how often you move the mouse and multiply that by the speed the CD-ROM is spinning. These add a lot of randomness, but none is truly random. Some companies have gone as far as using radioactive decay (a fundamentally random process) to avoid these problems.

I have a much simpler solution. Try adding the current NASDAQ or DOW to you random number. If the hacker manages to find a way to predict your random numbers now, steal his equation and use it to make millions because he just figured out how to predict the stock market! :)

Thursday, January 04, 2007

Kickball team programmers

Sorry for the delay between posts... You all know how December can be, which combined with a ton of work to do before the holidays resulted in a less than any contribution level to the blog...


So I've been thinking about how programming teams should be selected. As I've whined about before they are far to often selected according to the management structure that evolved out of the previous project. Shouldn't there be a better way?

What if we went back to the elementary school system for picking kickball teams? Each captain would take turns picking a programmer out of the crowd until both teams had everyone they needed.

Any programmers left would either be put on a team out of pity (especially if they're a new engineer learning the ropes) or they would be fired (because no one wants to work with them). This would be an interesting way of cleaning the gruff out of a group. It's a lot harder for one captain to say "I don't want you on my team any more" than for all of the captains to say "I already got enough people for my team, try a different team". Instead of taking an action to get rid of someone, it now takes action to keep them, and a group disinterest is the killer.

Now when would you pick teams? Obviously if everyone is working on a single project together, it would make sense to mix up the teams after a big event like a project shipping or whatnot. But what if you changed teams more often, say every few weeks or months. Obviously there are a lot of projects that take much longer than that, and you would like to avoid changing engineers. So how could you keep an engineer? Well you could pick him early. That engineer is more valuable to you than others because he is in the middle of a project for your team. But that means you're picking him instead of a better engineer who isn't in the middle of a project. Is that unfair? It would seem to hurt the stronger engineers. But any project that is new will not have anyone in the middle of something so these projects will be able to pick-up the good engineers that would otherwise fall behind. Of course the new projects are usually the fun ones so the engineers would be eager to finish their projects before the draft so that their current team wouldn't pick them early and they could end up on the new projects.

When a captain is selecting team members, it will be important to think about who to pick for any projects that will take longer than a single draft. If you pick someone very desirable, you'll have to spend your top picks on that engineer in future drafts to keep him around. If the project doesn't require a top engineer, you'd be better saving that project for a later pick who will be less difficult to keep around in the future.

Now there will always be cases where one team needs a few people this round and can't insure it will get all its picks before the other teams. In this case it might make sense to trade future draft round choices in order to get the members you want. You could for example trade your 2nd pick this time and next for another teams 1st pick this time and 3rd pick next. This would let teams that are in critical phases keep their team together, but still be fair to other teams.

Another consideration is how many picks each team should get. In kickball both teams need the same number of players so they can just alternate. But what if one programming project is twice as big as the rest? You could just give it twice as many picks, but then this team would end up being made up of one regular team plus a team full of left overs. To be fair you'd want to give this team more picks each turn. If the team is twice the size that's easy, but a less perfect number would make it harder. I'm sure you could work out a system where each captain gets a certain team size and they would all be allowed to fill the same fraction of their team as the draft continues.

It would also be important to determine who gets the first pick. Much like professional sports league drafts, there would be a huge difference between the first few picks, while in later rounds there would be less disparity. You could just rotate which team got the first pick, although with teams disbanding and starting this could be problematic. A lottery would work. In the end, however, it might make sense to let management determine the draft order. In the same way that management would pick how large your team should be, management could pick how elite your team should be. Some projects might do very well with a few good picks whereas they would require dozens of average picks. Other projects might not need the greatest engineers. In the extreme management could even assign the order in every turn so a team ends up with a few good picks at the top, and then a bunch of picks way lower down if they determine that to be the best makeup for the team.

The last big decision would be selecting who are the captains. It would seem obvious to have a few supervisors be the captains, but this could lead to unbalanced teams if the supervisors are not equally skilled. It could be like selecting your kickball captains and ending up with the best player and the worst player as captains. The one team is already at a huge disadvantage. Perhaps there could be a better way, or maybe like in kickball it just isn't fair sometimes.


I don't know how well this idea would really work, although in some situations it could be good. Maybe I should expand on the idea and come up with a "major league" style system where engineers can sign contracts for a few seasons and they can be traded and there could be a free market and an entry draft. Of course this would get so complex that the engineers would have to hire agents to try and find the best deal for them. Then the players would have to form a union.

Then again maybe not.