Contrary to your claim that "he can figure it out", my experience of interviewing candidates says that most can't.That's exactly why I said I would do it for a fee. It's real work correctly doing that sort of mathematical modelling. I note that your "transitive closure" method does not include a complete solution either. I also defend an alternative method of properly setting up hash keys (maybe AoA as values?) and doing the conventional cascading hash sort, including a subsort on the AoA's. It also begs questions like does point difference matter in the wins? Or is it just a binary value. etc. etc. So I may have flunked your interview......but that's because I'm more creative, or at least differently trained than you. No offense.... but your transitive sort dosn't really lead to a general purpose
solution, and there is no saying whether your transitive method is the best. I admit you are one of the few who have attempted a solution to the team rankings problem.
| [reply] |
Go back and read the original problem. There is a specification given. Debating whether another specification may be better (eg do points won by matter) is irrelevant, we are given the spec. There are 6 parts to the spec. The original poster claims to know how to do 5 parts of it correctly, and shows enough code to demonstrate that. The problem is that condition 3 is hard. The question is therefore, "How do I handle condition 3?"
Your answer pointed the original poster at different ways to do the bits that could already be done. It offered no help on condition 3. Therefore it did not address the question asked
My answer explained how to calculate that condition. I did not do the rest of the spec because I believe that the original poster can do that. Plus it is boring work.
If you wish to continue defend your answer on the grounds that it demonstrates that you have the "creativity" to answer the question that wasn't asked, and not answer the question that was, well, I don't quite know what to say to that. The situation pretty much speaks for itself.
Anyways we're now going in circles. Unless you have a response that breaks new ground, I won't be responding again in this thread.
| [reply] |
Ok, it's tiring to argue. Show me a 'White Paper" showing that "transitive closures" are the most mathematically clean solution to this problem, and I will conceed. But after googling for it, and reading it's wikipedia entry, it makes things even more confusing. :-) My idea is to make a multiplicative string of each team that you have beat. Then store that as a hash key. For the sort, divide that by the other team symbol, and cancel out values in the numerator. (Or something like that :-)...which would yield a value if you beat the other team. Of course, instead of a binary value there, we could move to real numbers, and account for point differential, weather, time of day, etc. You see where I'm going with this? Actually, about 30 years ago, there was an article in Sport's Illustrated about a guy who could predict thorobred horserace winners with a program similar to this. He entered all previous race data for the horses(teams), like weather, track, temperature, jockey weight, head to head wins, time of day, etc. Then he could set up his model with today's conditions, and predict who would win.
He was making a consistent profit by racing....probably with something like 30% accuracy. I too, am tired of arguing with a fellow monk, so this is all I say.
| [reply] |