- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Waiter: "Sure, go ahead. 103 is a funny one."
Guy: "103!" (room gets very quiet)
Guy: "What happened? Nobody laughed."
Waiter: "Some people just don't know how to tell a joke."
Admin
Wait! What's the rest of the iceberg this guy hit? Sadistic minds want to know! j/k...
Admin
Yes, it looks like the story is incomplete. WTF! I want to know what is the rest of the iceberg too!
Admin
wild guess...
sum(k = 1 .. n, choose(n, k)) * sum(i = 1 .. n, sum(j = 0 .. i-1, choose(i,j)))
n = maximum number of steps
First line is number of possible non-shorthand step combinations Second line is number of ways to insert commas in each set of steps.
yes? no?
x anon
Admin
So the puzzle about how many possible mods had to be answered, I made a quick python program:
N=45 mem = dict(); def rcount(p, before, skipping): if ( p >= N ): if( skipping): return 0 else: return 1 if(skipping): return count(p+1, 1, 1) + count(p+1, 1, 0) if(before): return count(p+1,1,0) + count(p+1,1,1) + count(p+1,0,0) return count(p+1,1,0) + count(p+1,0,0) def count(p, before, skipping): key = (p, before, skipping) try: return mem[key] except: r = rcount(p, before, skipping) mem[key] = r return r print count(0, 0, 0)The result is 101302819786919522
Admin
There's requirements, there's (wretched) design, there's (brain-dead) implementation, there's (predictably unhappy) day-to-day service delivery, and finally there's Supremely Cretinous Silver Bullet.
Similarly, there's math(s) and then there's counting.
Counting is inelegant. Symbols suffice.
Admin
Of course you are right. The story presented the table as the WTF, not the requirement. TRWTF is some unholy combination of the two.
ingenium?
Admin
Nice! Here's another variant I've heard. After the original conversation, we get:
Some Patron: "52!"
Crowd: jeers and catcalls
Guy: "What was that all about?"
Waiter: "Oh, that's Smith. He really ought to give up on that one - he can never quite handle the Swedish accent."
Admin
What I shown you was math translated to a python program, it was not 'counting'.
Want symbols? The result for N=45 is f(45, 0,0) where: { f(0, x, 0) = 1 f(0, x, 1) = 0
f(i, 1, 1) = f(i-1, 1,1) + f(i-1, 1,0) f(i, 1, 0) = f(i-1, 0,0) + f(i-1, 1,0) f(i, 0, 0) = f(i-1, 1,0) + f(i-1, 0,0) }
regards.
Admin
Think about it... it just make sense.
The only entries that exist in the table are that entries that actually be used... that means if somehow certain technicans skipped one of the steps that's actually be required, he would not be able to enter it here.
Only that it there should be function that used to check the missing steps...... :P
Admin
The fact that anybody working on that system can see it as 'workable' makes me feel nauseous
Admin
Actually, all calculation methods so far are wrong.
If anybody wants the real result, in a symbolic way then take this matrix:
[ 2 0 1 ] [ 1 1 0 ] [ 1 1 0 ]
Raise the matrix to the 45th power (K=45) and the count will be in the top left of the result matrix.
I.E: If K=1 Then there are two results: 1 and [empty] . Do the above procedure and you get 2.
For K=2 the result is 5: (empty); 1 ; 2; 1,2 ; 1-2; And the thing works.
For K=3, the result is 13:
(empty) 1 1,2 1-2 1,2,3 1-2,3 1,2-3 1-3 1,3 2 2,3 2-3 3
The math behind is a long story and I don't think you guys are too interested in it.
Admin
Also what about "diaphragm pumps screw arranged marriage"?
Admin
3 692 890 883 188 542 000 000
Admin
...and a turkey baster
Admin
Ah, I think I can help out there. What we need is an extra table to map the bad combinations to their correct versions.
Admin
Parsing those strings was part of the job of the first C++ class I ever wrote back in 1993
Admin