4 ms·
If the point is that Harry solved the problem but failed to consider the politics of the solution, and so was fired, wouldn't it make more impact if he was the
by kerno 14y ago
If the point is that Harry solved the problem but failed to consider the politics of the solution, and so was fired, wouldn't it make more impact if he was the only one to declare that the Boss should be fired, instead of all three of them doing so?
If that isn't the point, then I don't know what the point is meant to be.
- bengillies 14y agoI believe the point is that he was fired because he spent a full day coming up with a complex solution to a trivial problem and that when he eventually did arrive at a solution, it was impossible for everyone else to understand and verify.
- rbehrends 14y agoAnd the fact that it being a monoid is actually irrelevant to the solution. It is a lattice with an artificially created lower bound [1], which does induce a monoid structure via its join operation, but by thinking about it as a monoid, you abstract out the one relevant property (ordering!) that you actually care about. [1] Assuming that there aren't any duplicate elements, in which case it technically isn't either a lattice or a monoid, unless you consider equivalence classes modulo attribute equality.
- yen223 14y ago"Well", Harry said, "If you are asked to add two employees, return the guy who is older. But if both of them are the same age, then return the guy who has been with the company the longest. But if both guys have been working for us for the same number of years, then return the guy with the lowest salary. But if they both earn the same as well, then just randomly pick one over the other" I didn't think that was very hard to understand or verify.
- jpatokal 14y agoExcept the obvious: why the hell is he "adding" employees, and what does that even mean?
- deleted 14y ago[deleted]
- yen223 14y agoHaha, poor choice of words there. When he says "adding", he really means "apply a binary operation A • B, which returns A if ....". The key point is: Once you can define a binary operation which is associative, and an identity element I for which A • I = A, you can consider using monoids.
- dxbydt 14y agoWell, lets say you have 3 elements (1,2,3) with 2 being 0. So since 2 is 0, 1+2=1=2+1, 2+2=2, 3+2=3=2+3. With me so far ? So what's 1+3 ? Well, it cannot be 1 because you could then cancel the 1's and 3 would become 0, but 3 isn't 0, its 2, because we just said so. 1+3 is obviously not 3, because by the same reasoning of cancellation, you'd end up with 1 equals 0, which it ain't cause 2 is 0. So by the weird magic of Niels Abel, 1+3 must indeed be 2. Because it just can't be anything else, yeah ? You only have 3 elements to play with, and 1+3 better be one of those. Similarly, you can work it out that 1+1=3, 3+1=2 and 3+3 =1. That completes your Cayley table and you can collect your paycheck and go home to wife and kids, because with 3 elements your Cayley has 9 slots. But when you have 10,001 employees, your Cayley will have 100 million slots. Unless you have a rule to fill those slots, you won't be able to fill the Cayley. "Adding employees" is simply a rule to fill the Cayley. HTH :)
- nilkn 14y agoWho knew there was such a bias against mathematics on Hacker News? The basics of abstract algebra need to be disseminated more widely. These are not hard concepts. Adding employees means exactly what it was defined to mean in the article. It's an associative binary operation.
- 14y ago
- pippy 14y agoExactly. If you're getting paid $60 an hour, you just wasted $500. Someone who knows SQL (or in this case Scala) could do this problem in seconds. "didn't give a rat's ass about efficiency." is a bit redundant - you're running the query once and you're getting paid by the hour. That being said, the manager asking a math major to do an information science task seems a tad incompetent.
- Dylan16807 14y agoI was going to call your comment ridiculous but then I reread and saw that he actually did spend an entire day on it. Wow. Removing the trivial if chain you only have five lines! And it's not doing anything crazy, just a fold. Let me put it this way: If I was the boss and Harry had spent the day learning about functional programming then okay sure whatever. But if he knew all the concepts he was using and spent the entire day just to pick one then there is a serious problem.
- grannyg00se 14y agoI thought the point was to show that every problem has multiple solutions. And even when you think you have the most elegant solution it's worth thinking about it again.
- Steko 14y agoRead the title and was sure it was going to be some bullshit management recipe for turning the place around. Anyway if spoilers employee number 7435 was the boss and they have 10K employees and none with more than 6 years of tenure or making over 150K, Harry is lucky to be out of that place.
- pessimizer 14y agoMaybe it was just an framing story to illustrate three approaches to the same problem; maybe mainly to give an example of a monoid... I have no idea, but I did like Harry's explanation:)