text:
Evaluate the nth hyperoperation
I do realise that this is a bit math-y, but - here goes.

In mathematics, the hyperoperation sequence is an infinite sequence of arithmetic operations (called hyperoperations) that starts with the unary operation of successor, then continues with the binary operations of  addition, multiplication and exponentiation, after which the sequence proceeds  with further binary operations extending beyond exponentiation, using right-     associativity.

Your goal is to write a program that takes three integers x, y and n as input and outputs the result of the nth hyperoperation on x and y.
E.g.
1 1 1 outputs 2
2 4 4 outputs 65536
3 3 4 outputs 7625597484987

The program must be written in the shortest bit of code.
You may take input either from STDIN or from a file.
Library functions not allowed.
Input constraints: n will be ≥ 1.

http://en.wikipedia.org/wiki/Tetration has a good explanation in case you can't wrap your head around this.

What is n=1? If it's x+y or x+1, 1 1 1 should return 2

I knew I had made a mistake somewhere :) fixed, thx.

3^3 = 27. Did you mean 3 3 4=>762...987?

Yes, I did :( /10

I've written me a pseudo-code, then I realised that it's actually a valid Ruby code (almost :-( )

Ooh, Ruby! Post it.

once I remove the "almost" part :-(

do I have to support n=0? n=1 behaves differently than all higher ones.

No, n >= 1 only.

does it have to be reasonably fast? :-)

I won't mind speed! Just post it.

related Implement hyperexponentiation/tetration without the use of '^'

Yes, but it's a bit different.

This is basically a subproblem of the Graham's number challenge, or at least of my solution.

Shall the code handle case y=0?

Yes, it should.

There is debate on whether successors are the 1st (or 0th) hyperoperator. See https://googology.wikia.com/wiki/User_blog:Eners49/The_secret_0th_hyper-operator%3F

Ruby, slow, 86 84 83 characters
def f x,y,n
n>1?(c=x;2.upto(y){c=f(x,c,n-1)};c):x+y
end
p f *gets.split.map(&:to_i)

Ruby, fast, 96 94 93 characters
def f x,y,n
n>1?(n>2?(c=x;2.upto(y){c=f(x,c,n-1)};c):x*y):x+y
end
p f *gets.split.map(&:to_i)

The first version is way too slow with the last test case, so I added a version that uses multiplication as the base case instead of addition. The first version takes ages to calculate 3 3 4; the second one is instanteneous (in the native IRB console; the web version is a bit slower).
Several beauties of Ruby show up here:
Almost every statement is an expression in ruby. Thus, you can stuff semicolons inside the ternary operator, provided you've got enough parentheses lying around. Coffeescript borrowed that one. It also borrowed Ruby's "no parens needed" call syntax.
Implicit returns: this is a cool feature, and follows from the previous. Indeed, starting the last line of a function with return is considered lame, even when not golfing.
Numbers are objects in ruby (even null is an object). In ruby, integers have the method times, which executes the block passed to it several times. This is just one of Ruby's many iterator methods. Here, the upto method lets us save two more characters over what times lets us.
unary * is the splat operator here. It turns an array into an argument list. Just like Javascript's Function#apply, but it's shorter and better.
unary & turns a procedure into a block. While :to_i is a symbol, it converts into a procedure pretty well. Namely, it turns into a procedure that calls to_i on its argument and returns the result. More information on Stack Overflow.
It would be possible to get it even faster by using n=3 as the base case, but I'm afraid it is not needed. It would only cost 11 characters, though, thanks to another beauty of ruby: the exponentiation operator **. Python has this operator, but it's not the first one (as @aka.nice noted - thanks -, Fortran already had this operator).
online ruby interpreter available here: http://repl.it/Ikj/1

Nice, but I'm still waiting for an output from 3 3 4 :) it's very slow.

@SohamChowdhury the base case is addition. With a base case of multiplication, it would be very slow as well (and longer). I recommend testing with exponentiation instead ;-)

It might save time to use memoization, but that would cost some bytes (quite a few)

Add another version then :)

@SohamChowdhury you said you didn't care about speed :-( hold on, I'll try to see how fast a multiplication-based version will be.

@SohamChowdhury done; at just 10 characters, I've turned it from "eternal" to "instanteneous".

Yeah, right. Nice!

operator ** already existed in FORTRAN in the 50's and ALGOL would have 1 character less with up arrow

APL, 62
{1=3⌷⍵:2⌷+\⍵⋄0=2⌷⍵:(⍵[3]⌊3)⌷⍵[1],0,1⋄∇⍵[1],(∇⍵-0 1 0),3⌷⍵-1}⎕

{...}⎕: Takes evaluated input (space-separated numbers evaluates to a numerical array) and apply function to it.
1=3⌷⍵:: If n equals 1...
2⌷+\⍵: Return sum of first 2 elements (x+y)...
⋄0=2⌷⍵:: Else if y equals 0...
(⍵[3]⌊3)⌷⍵[1],0,1: Create numerical array [x,0,1] and return index min(n,3)...
⋄∇⍵[1],(∇⍵-0 1 0),3⌷⍵-1: Else return ∇(x,∇(x,y-1,n),n-1). (∇ is self-reference)

I have got a "hyper-raiser" operator, which takes a function and return next hyperoperation
{⍺⍺/⊃⍴/⌽⍵}

For example, +{⍺⍺/⊃⍴/⌽⍵} would be the multiplication function and +{⍺⍺/⊃⍴/⌽⍵}5 3 outputs 15.
But can't get it to recurse. Maybe someone else can do it.

Ah, APL. Beats Python for simplicity any day.  How do I run this?

APL (Dyalog Unicode), 31 23 22 bytes (SBCS)
Saved 6 bytes thanks to Bubbler
{×a←⍺-1:a∇⍣⍵×⍺-2⋄⍵+⍺⍺}

Try it online!
Can be used as n (x f) y.
{
 ×a←⍺-1:     ⍝ Check if n is greater than 1
  a←⍺-1      ⍝ Assign n - 1 to a variable a to reuse later
 ×           ⍝ Sign of a (0 if addition, 1 otherwise)

  a∇⍣⍵×⍺-2  ⍝ Apply the (n-1)th hyperoperation y times to x
       ×⍺-2  ⍝ Sign of n-2 (the identity for the nth hyperoperation
    ⍣        ⍝ Power operator, apply
   ∇         ⍝ the derived function (f x)
     ⍵       ⍝ y times
       ×⍺-2  ⍝ to the identity
  a          ⍝ With n-1 as the new n

⋄
⍵ + ⍺⍺     ⍝ n is 1 (addition)
}
```

25 bytes, using n (x f) y instead.

... and then 23 bytes using ⍣ instead of /.

@Bubbler Thanks! I'm not sure how it works anymore, though :)

In an operator, single ∇ means to recurse the derived function (same as ⍺⍺∇∇ here). ×⍺-2 is the (right-)identity, and (⍺-1)∇⍣⍵ can be thought of applying x (n-1th hyperop) y times on the left. Like this: $ 2 \times 3 = 2+(2+(2+0)) = (2+)^3 (0)$.

@Bubbldr Thanks, it makes sense now.

Jelly, 15 bytes
ṛ+⁵ðx’ß@ƒ>2¥ðỊ?

Try it online!
Writing a 3-argument program in Jelly is hard, though at least we need to use one of them only once in this problem. So this program takes three arguments in the order of n y x and recurses as a dyadic function. Roughly a hybrid of this Ackermann solution with user's APL answer.
How it works
ṛ+⁵ðx’ß@ƒ>2¥ðỊ?    Main program as a dyadic link.
                   Left = n, Right = y, 3rd arg (⁵) = x
A..ðB.......ðC?    If C then A else B
             Ị     If n <= 1
ṛ+⁵                Then y + x
    x’ß@ƒ>2¥       Else...
    x’             y copies of n-1
      ß@ƒ>2        Reduce with the program itself flipped, with
                   the default value being n>2 (1 or 0)

Python, 96 92
def h(x,y,n):r=1;exec(n>2)*y*"r=h(x,r,n-1);";return(r,(x+y,x*y)[n>1])[n<3]
print h(*input())

Input: 3, 3, 4
Output: 7625597484987
Shortened using a couple of @WolframH's ideas.

Python, 83
(Based on flornquake's answer)
def h(x,y,n):r=n>2;exec"r=h(x,r,n-1);"*y*(n>1);return(x+y,r)[n>1]
print h(*input())

Very slow for large results.
For 2, 4, 4 the output is 65536.

"very slow" is the reason my 86-character solution was considered bad.

@JanDvorak: Why do you think it was considered bad? Soham Chowdhury just said it is slow and that you should add another version, not that you replace your solution. (But maybe I misunderstood that.)

You're right; restored the short version. Now I'm just a char longer than you.

@WolframH exactly. Always nice to have versions.

Smalltalk Squeak 4.x flavour many bytes!
I could implement one of the recursive form in Integer in 71 char
f:y n:n n=1or:[^(2to:y)inject:self into:[:x :i|self f:x n:n-1]].^self+y

Then reading from a file or FileStream stdin will cost me an arm... Squeak was obviously not designed as a scripting language. So I will spend many bytes to create my own general purpose utilities unrelated to the problem:
Implement this 21 char method in Stream (to skip seaparators)
s self skipSeparators

Implement this 20 char method in Behavior (to read an instance from a Stream)
<s^self readFrom:s s

Then 28 chars in String (to create a file handle)
f^FileDirectory default/self

Then 59 chars in FileDirectory (to create a readStream)
r^FileStream concreteStream readOnlyFileNamed:self fullName

Then 33 chars in BlockClosure (to evaluate it n times)
*n^(1to:n)collect:[:i|self value]

Then 63 chars in Array (evaluate the argument with receiver and arguments taken from the Array)
`s^self first perform:s asSymbol withArguments:self allButFirst

then solve the problem by evaluating this 31 char snippet anywhere to read from file named x
|s|s:='x'f r.[0class<s]*3`#f:n:

Even without counting the utilities, that's 71+31=102 chars already...
Now, since I'm sure to lose the codeGolf, I have a funnier implementation in Integer:
doesNotUnderstand:m
    (m selector allSatisfy:[:c|c=$+])or:[^super doesNotUnderstand:m].
    self class compile:
        m selector,'y y=0or:[^(2to:y)inject:self into:[:x :i|self'
        ,m selector allButLast,'x]].^'
        ,(Character digitValue:()asBit)
        ,(m selector size-2min:1)hex last.
    thisContext sender restart

This method will define (compile) a binary messages made of n + if it does not exist (is not understood by the receiver of the message m), and will restart execution at the beginning of sender context. I inserted additionnal carriage return and spaces for readability.
Note that (m selector size-2min:1)hex last is a shorted form of (m selector size>2)asBit printString.
If it was not to demonstrate Smalltalk evil superpowers, the last statement could be replaced by shorter and simpler
^m sendTo:self

Now implement 28 chars utility in Character (to repeat it n times in a String)
*n^String new:n withAll:self

Then evaluate this 43 chars expression:
|i s|i:=0class.s:='x'f r.[i<s]*2`($+*(i<s))

We can accelerate with 10 more chars by implementing in Integer:
++y^self*y

and in this case we also have shorter code because we can replace ^',(m selector size-2min:1)hex lastwith ^1'
For such a high price, the code work with second integer=0 :)

Golfscript, slow, 39 characters
 ~{\(.{3${[4$\2$4$.~}4$(*}{;;+}if])\;}.~

(live link)
This is the standard recursive algorithm with a base case of n=1 (addition) (i.e. slow). The same I've used in my Ruby solution
Here's a version with my annotations (mostly stack-keeping). It doesn't include one optimisation I've added later:
~{            #read the input and do (x y n f)
 \(.{         #(x y f n-1); if(n-1)
  3${         #(x y f n-1 c)
   4$\2$4$.~  #(x y f n-1 x c n-1 f); call
  }3$(*       #y-1 times
  {\;}4*
 }{           #else
  ;;+         #return (x+y)
 }if
}.~           #once

~ is the eval operator. In case of strings, it treats the string as a GolfScript program. Luckily, a space-separated list of integers is a valid GolfScript program that pushes those integers on the stack. Compared to this, my previous version of the input routine (" "/{~}/, split by space and eval each) is pretty lame. In case of functions, it calls the function. When preceded by . (clone), it calls the function with itself as the first argument.
Golfscript doesn't seem to be exactly well suited for making recursive algorithms. If you want a recursive algorithm that isn't tail-call optimisable, you need to create and destroy stack frames to preserve your variables. In most languages, this is done automatically. In golfscript, you have to actually clone the variables (actually, stack entries), and destroy the stack entries you no longer need. Golfscript has no concept of stack frames. Have I said GolfScript is a stack-based language?
The first requirement is understandable. You have to specify the arguments somehow. It's only nice if they keep their original positions as well. The second requirement is unfortunate, especially since the return value is on the top of the stack, and golfscript lacks the ability to delete just any stack element. You can rotate the stack and discard the new top element, but that quickly builds up. \; is fine. \;\;\;\;\; isn't. You can do \; in a loop ({\;}9*; cost: 6 chars to discard up to 9 elements, or 7 chars to discard up to 99 elements), but we can do better:
Golfscript has first-class arrays. It also has the array literal syntax [1 2 3 4]. What's unexpected is that [ and ] are not actually a part of the syntax. They are merely two operators: [ marks the current position on the stack, and ] collects every element until it finds the start-of-array mark or runs out of stack, and discards the mark. You can even tear these two apart and see what happens. Well, quite an interesting thing:
Did I say golfscript has no concept of stack frames? I lied. This is a stack frame: [. You can discard it all at once: ];. But what if we want to keep the return value? You could close the stack frame on function entry (then we have a slightly mangled version of pass-by-array - not an interesting concept), or we can close the stack frame and take its last element instead of discarding it completely: ]-1= or we can uncons the last element instead, and then discard the frame: ])\;. They're the same length, but the latter is slightly cooler, so I'm using it.
So, instead of 6 or 7 characters to do a clean-up, we can do with 5. I still feel this could be golfed more, but hey, we've saved a character.

"calls the function with itself as the first argument" - interesting idea for recursion

Groovy - 77
h={x,y,n->n<2?x+y:y<2?x:h(x,h(x,y-1,n),n-1)}
print h(args.collect{it as int})

Note: it requires obscene amounts of stack (and time) for non-tiny arguments.

R, 70 bytes
h=function(x,y,n)`if`(n<2,x+y,{z=n>2;while(y){z=h(x,z,n-1);y=y-1};+z})

Try it online!
As other answers have noted, recursing back to the n=1 hyperoperation of addition is rather slow by the time that n>3 and the hyperoperation is tetration or worse.  TIO link includes recursive version starting at n=2 (multiplication) to check that the approach is sound and works for the last test-case...

R, 78 74 bytes
(for all n, including n=0)
h=function(x,y=x,n)`if`(n<2,x^n+y,{z=n>2;while(y){z=h(x,z,n-1);y=y-1};+z})

Try it online!
This was one of those frustrating problems where I couldn't resist going-ahead and trying to write the shortest general solution, even if n=0 wasn't required by the question.
The behaviour of n=0 (increment) and n=1 (addition) is different to all subsequent hyperoperations, since y=1 is not an identity function for these two cases.  I've worked-around this by stopping recursion when n<2, and returning x^n+y, which manages to satisfy both the n=1 and n=0 cases.
For added niceness (at the cost of another +2 bytes), we can specify a default value for y of x, which means that it needn't be provided as an argument at all for n=0, since this is can be considered a unary operation on y.
So: +4 bytes wasted, but I'm happier now.

Haskell, 45 bytes
1?x=(x+)
n?x=(!!)$iterate((n-1)?x)$signum$n-2

Try it online!
Call it with (n?a)b.
Haskell, 51 bytes
(1?a)b=a+b
(2?_)0=0
(_?_)0=1
(n?a)b=(n-1)?a$n?a$b-1

Try it online!
Copied straight from the hyperoperation formula on Wikipedia. Call it with (n?a)b.

AXIOM Computer Algebra System, bytes 69
p(x,y,n)==(n<=1=>y+x^n;n=2=>y*x;n=3=>x^y;y<=0=>1;p(x,p(x,y-1,n),n-1))

test:
(2) -> p(1,1,1)
   (2)  2
                                                 Type: Expression Integer
                                   Time: 0.05 (IN) + 0.03 (OT) = 0.08 sec
(3) -> p(2,4,4)
   (3)  65536
                                                 Type: Expression Integer
                                                              Time: 0 sec
(4) -> p(3,3,4)
   (4)  7625597484987
                                                 Type: Expression Integer
                                                              Time: 0 sec

This would eliminate some recursion...Possible I swap in x and y in some return...  are there other test values?

APL(NARS), chars 61, bytes 122
{(x y n)←⍵⋄n≤1:y+x*n⋄n=2:x×y⋄n=3:x*y⋄y≤0:1⋄∇x,(∇x(y-1)n),n-1}

test:
  h←{(x y n)←⍵⋄n≤1:y+x*n⋄n=2:x×y⋄n=3:x*y⋄y≤0:1⋄∇x,(∇x(y-1)n),n-1}
  h 1 1 1
2
  h 2 4 4
65536
  h 3 4 4
∞
  h 3 3 4
7625597484987

Scala, 90 bytes
Port of @John Dvorak's Ruby answer in Scala.

Golfed version. Try it online!
(x,y,n)=>if(n>1){if(n>2){var c=x;for(i<-2 to y.intValue)c=f(x,c,n-1);c}else{x*y}}else{x+y}

Ungolfed version. Try it online!
object Main extends App {

  def f(x: BigInt, y: BigInt, n: BigInt): BigInt = {
    if (n > 1) {
      if (n > 2) {
        var c = x
        for (i <- 2 to y.intValue())
          c = f(x, c, n - 1)
        c
      } else {
        x * y
      }
    } else {
      x + y
    }
  }

  println(f(1, 1, 1))
  println(f(2, 4, 4))
  println(f(3, 3, 4))

}

C (gcc), 90 bytes
-2 bytes thanks to @ceilingcat!
_;h(a,b,n){int k=_++||!scanf("%d%d%d",&a,&b,&n),j=a;for(--n;n&&--b;)a=h(a,j,n);_*=k;a+=b;}

Try it online!
Ungolfed and explained:
_;
h(a,b,n)
{
    int k = _++ || !scanf("%d %d %d", &a, &b, &n),
    j=a;

    for (--n; n && --b;)
        a=h(a,j,n);

    _*=k;
    a+=b;
}

The code applies the nth hyperoperations to a and b, respectively. These inputs need not be provided by the caller, since they're immediately reinitialized anyways. _++ || !scanf("%d %d %d", &a, &b, &n) makes a, b and c be read from stdin if and only if _ is non-zero (that is, if the current function call is not a recursive one - if it's called by another function rather than itself). The expression returns 0 if any new characters were read and nonzero if they weren't, making k an indicator for whether the current function call is a recursive one or not.
Then, the for loop applies the n-1th hyperoperation to a b times, using j to store the initial value of a and a to store the intermediate values. Finally, _*=k makes _ zero again if and only if the current call is not a recursive one, so that the next call will reread the values of a, b and c, and b is added to a. Usually, b would equal 0 after the for loop, but if n equaled 1, the for loop wouldn't be executed at all and the function returns a + b. Note that the value of a is returned after a+=b since assignments and returns are usually stored in the same register.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Challenge: take ciphered text and decipher, also print out if it was offset to the left or right
Problem:
Take input text like this: (all input should be considered strings)
 Upi djpi;f ytu yu[omh pmr yp yjr ;rgy.

And figure out if it was offset left or offset right (on a standard qwerty keyboard as pictured below).
Also only keys that output something to the screen are considered valid, so these keys: caps, shift, tab, enter, delete(backspace), should not be considered when doing this challenge.

Once you have figured out what the offset is, print out the offset and the correct text.
For example the above input would have this output
 text: You should try typing one to the left.
 offset: right

Your program has to 'know' that the sentence is correct before it prints out. (so no asking for user verification). Also no using libraries (should be a given).
All input will begin with a capital and end in a period (the period will not be offset left or right so you won't be able to use it to determine the offset.)
Another example:
U kujw oeife'nnubf xibrwara.

I like programming contests.

Some input samples to use:
 X'ra 'bs sifa 'ew ai o'aaw.
 Yjod vpmysod sm stnoysto;u ;pmh eptf.
 Rgw x'r ;b rgw g'r qwbr iyr ri v'r.
 Og upi vtrsyr s d,s;; fovyopmstu pg yjr ,pdy vp,,pm rmh;odj eptfd yjrm upi vsm vjrvl upit piy[iy gpt yjpdr eptfd' yjr eptf ayjra smf yjr eptf asmfa str imowir ejrm pggdry ;rgy smf pggdry tohjy. //<< don't put this deciphered text in your answers.

And bonus option: write your program to be able to handle the input switching offsets.
Example above with switching offset:
Upi djpi;f ytu yu[omh ibw ri rgw kwdr.

text: You should try typing one to the left.
offset: right -> index[21], then left.

Winning criterion:

Faster code gets more points (out of 10) so O(logn) would score more then O(n^2) solutions (obviously).
Elegance (out of 20) There is a very elegant and simple solution to this problem. The closer you get to the simple solution the higher your score. (bonus +5 if you think of something simpler then my solution).
This is not a code golf, but concise readable code will be scored (out of 10).
Bonus is all or nothing for 5 extra points.

So A perfect score would be 40 but you could score up to 50 if you get both bonuses.
bonus +2 if you read all instructions

All questions on this site, whether a programming puzzle or a code golf, should have … An objective primary winning criterion, so that it is possible to indisputably decide which entry should win. (see also discussion).

@PeterTaylor I thought I had provided a decent grading criteria. I know of a very simplistic (elegant) solution, you could end up writing something very slow very easily, and I believe that more then one person would be able to read the submissions and decide if they are concise and readable. The bonus is also very clear cut, either your code does it or it does not. I don't see how 'An objective primary winning criterion' precludes the use of a scoring rubric.

If anyone disagrees with my score, then the score is not objective. This is why I hate writing essays and other text in school: the teacher basically marked the tests without any objective criteria.

The bonus option is clear cut, but it's the only part of the scoring system which is. The speed criterion could be made objective; concision could be made objective; readability is always going to be up for debate (especially in a context in which languages which don't have "official" style guides are used); and elegance is a dead-cert source of arguments (not to mention that if you get hit by a bus no-one will be able to know which answers would qualify for the bonus).

@PeterTaylor please suggest ways then to fix the criteria. I spent a lot of time thinking of this question and would appreciate any help I can to make it solid and attract attention.

The easiest way to fix the criteria is to handle the speed one by giving a large test case with a generous time limit (e.g. "Must handle this 10k input in a minute"; generous to account for varying CPU speeds); and then to make it pure code-golf on the basis that elegant answers tend to be short. If you're really worried about readability then discount unnecessary whitespace and count names as 1 unit each unless they can't be changed without breaking the program.

I would also improve the question by specifying which of the hundreds of standard QWERTY keyboard layouts you have in mind, and what assumptions can be made about the source statistics. I would also clarify the corner cases, including some tests for them. E.g. if the input is Rge BRWKIOW are you expecting the decoded string to be The antelope or The NTELOPE? What about U gCW b escEJ?

@PeterTaylor I don't want it to be a code-golf because I am a web programmer, and often you can't compete at code-golf with the languages that I typically use. I wanted something that was open to all languages but still has some sort of measurement of code quality. Also as for your Rge BRWKIOW that would be thr ntelope or efw veqjuiq there is no way using a one off left or right offset that you could get the antelope and U gcw b escej would be I hVE n rdvRK or Y fxq v waxwh. I will implement your other suggestions though.

The second last input sample you gave ('Rgw...') might have a typo. It seems the semicolon in the string should be an 'i' instead.

This is a very interesting problem, but I agree that the scoring is weak.  For a problem like this, everyone should know what their score is and what the other scores are.  Your input as a judge (with criteria that are partially unknown to us) makes the results unclear.

@Volatility normally that would be, however that test case is correct as posted.

@dan1111 Ok, how would you suggest I change the scoring criteria so that I remove myself from the scoring? I am very open to suggestions, except for making it a strait code-golf.

@ryan, you could give specific points based on the speed of the solution.  e.g. O(log n) or better is worth 100, O(n) or better is worth 80, etc. You could give a specified bonus for the solution that takes the fewest number of operations (approximating your "find the elegant solution" criterion). For "concise readable code", you could add a score based on the number of characters in the solution, excluding whitespace and comments, and counting all variable names as one character.  That would come close.

@dan1111, define "operation" in a way which is applicable consistently to C and J.

Is there any possibility that there will be a full stop mid-sentence? As in a comma that has been shifted right.

Python
The original version didn't deal with punctuation too well, so here's a revised version.
r = dict(zip('\\qwertyuio\'asdfghjkl;/zxcvbnm|:"?', 'qwertyuiopasdfghjkl;\'zxcvbnm,Q"AZ'))
l = dict(zip('wertyuiop[\'asdfghjkl;xcvbnm,.{:"<', 'qwertyuiop;\'asdfghjklzxcvbnm,PL:M'))
shifts = {'right': r, 'left': l}

def shift(ciphered):
    letters = set(ciphered)
    if letters & set('p[{,<') or any(i in ciphered for i in ('yjr', 'smf')):
        return 'left'
    elif letters & set('qz\\|/?') or any(i in ciphered for i in ('rgw', '\'bs')):
        return 'right'
    else:
        return 'right' if ciphered.count('w') > ciphered.count('y') else 'left'

def decipher(ciphered):
    ciphered = ciphered.split('.', 1)[0].lower()
    shift_ = shift(ciphered)
    text = ''.join(shifts[shift_].get(i, i) for i in ciphered).capitalize()
    print 'text:', text + '.'
    print 'offset:', 'left' if shift_ == 'right' else 'right'

decipher(raw_input())

This is how it works:

If any of the characters p[{,< are in the ciphered string, or yjr or smf (the and and shifted right respectively) are in the string, then the string must have been shifted right.
If any of the characters qz\|/? are in the ciphered string, or rgw or 'bs (the and and shifted left respectively) are in the string, then the string must have been shifted left.
If neither of the above are true, then we compare the counts of 'w' and 'y' in the string. If there are more 'w's, then it is most likely to have been shifted left, because 'e' is more common than 'u' in English. If not, then it probably would have been shifted right, since 't' is much more common than 'q' in English.

The original function used 'w' and 's', however using e/u and q/t will theoretically produce much stabler results, as the frequency differences between the letter pairs are higher than those of the original e/d and q/a.
This will work for most strings, however theoretically there might be some strings who will give the wrong output. (If you find one, post the offender in the comments and I will try to make the test more stable)

We reverse-shift the string accordingly, to produce the output.

Note that if there is a comma in a string that has been shifted right (ie there is a . in the ciphered string excluding the one at the end), then this will not work, as the function only deciphers the part before the first period in the string.
Here are some sample test results.

Very clever, And something I hadn't thought of. I will have many more test cases later today and I may switch some of the scoring to how many of the test cases can be run correctly.  But +1 for your current solution.

Nice approach and explanation.

Tcl
set right {q w w e e r r t t y y u u i i o o p p {[} {[} \] \] q Q W W E E R R T T Y Y U U I I O O P P {[} {[} \] \] Q a s s d d f f g g h h j j k k l l {;} {;} ' ' a A S S D D F F G G H H J J K K L L {;} {;} ' ' A \\ z z x x c c v v b b n n m m , , \\ \\ Z Z X X C C V V B B N N M M , , \\}
set left {q \] w q e w r e t r y t u y i u o i p o {[} p \] {[} Q \] W Q E W R E T R Y T U Y I U O I P O {[} P \] {[} a ' s a d s f d g f h g j h k j l k {;} l ' {;} A ' S A D S F D G F H G J H K J L K {;} L ' {;} \\ , z \\ x z c x v c b v n b m n , m \\ , Z \\ X Z C X V C B V N B M N , M}
gets stdin data
set len [string length $data]
set min 0
set res {}
foreach {d} {left right} {
   set trans [string map [set $d] $data]
   if {[string first " and " $trans] > 0 || [string first " the " $trans] > 0} {set v 1} {
       if {[regexp {[\]\[]} $trans]} {continue}
       set vocals [regexp -all -nocase {[aeiou]} $trans]
       set v [expr {($vocals * 1. / $len)}]
   }
   if {$v > $min} {
       set res "$trans\noffset: $d"
       set min $v
   }
}
puts $res

I build a map to replace the characters with the next.
If there are strange characters in the output, I'll reject it.
As last chance I take the highest vocal/length count.
I claim the +2

Because I have (currently) the fastest, most elegant & most readable code, I have a score of 42.

Lua
The idea is to determine which group of letters is prevailing: ABIUW or JOPY.
The former has frequent letters on next key to the right on the keyboard, the latter - to the left.
local strings = [[
Upi djpi;f ytu yu[omh pmr yp yjr ;rgy.
U kujw oeife'nnubf xibrwara.
X'ra 'bs sifa 'ew ai o'aaw.
Yjod vpmysod sm stnoysto;u ;pmh eptf.
Rgw x'r ub rgw g'r qwbr iyr ri v'r.
Og upi vtrsyr s d,s;; fovyopmstu pg yjr ,pdy vp,,pm rmh;odj eptfd yjrm upi vsm vjrvl upit piy[iy gpt yjpdr eptfd' yjr eptf ayjra smf yjr eptf asmfa str imowir ejrm pggdry ;rgy smf pggdry tohjy.
]]
for str in strings:gmatch'%C+' do
   str = str:lower()
   -- compare total counters of letters ABIUW and JOPY
   local _, left_ctr  = str:gsub('[abiuw]','')
   local _, right_ctr = str:gsub('[jopy]','')
   local offset = left_ctr - right_ctr
   offset = offset / math.abs(offset)  -- offset == (+1) or (-1)
   -- restore original string
   local original = ''
   local keyboard = "asdfghjkl;'?zxcvbnm,'qwertyuiop['"
   for c in str:gmatch'.' do
      local pos = keyboard:find(c, 1, true)
      c = pos and keyboard:sub(pos + offset, pos + offset) or c
      original = original..c
   end
   print('text: '..original:sub(1,1):upper()..original:sub(2))
   print('offset: '..({[-1]='right', 'left'})[offset])
   print()
end

Output:
text: You should try typing one to the left.
offset: right

text: I like progr?mming contests.
offset: left

text: C?ts ?nd dogs ?re so p?sse.
offset: left

text: This contais an arbitarily long word.
offset: right

text: The c?t in the h?t went out to b?t.
offset: left

text: If you create a small dictionary of the most common english words then you can check your output for those words; the word the and the word and are unique when offset left and offset right.
offset: right

Haskell
Certainly not the fastest or smallest one, but at least now there is a Haskell solution!
The idea

Write in the code the configuration of the keyboard, one string per keyboard line
Generate left and right shifted keyboard and build dictionaries of keys correspondences
Create a ShiftString method that convert a string with right or left dictionary
Write an englishProb function that compute the least square between frequency of a given string and the english language frequencies
Implement a method chooseShift that convert a string to left and right shifted sentences, compute the englishProb on them and return the dictionary minimizing the least square error
Write a solve method that take a string, choose the best dictionary, convert the sentence with it, and format the output as desired
Create the main function that use solve on input

The code
import Data.Char
import Data.List

main :: IO()
main = do
    content <- getContents
    putStr . unlines . map solve . lines $ content

solve :: String -> String
solve s = "text:" ++ shiftString shift sc ++ ".\noffset: " ++ offset shift
    where sc = takeWhile (/='.') s
          shift = chooseShift sc
          offset sh | sh == left = "left"
                    | sh == right = "right"
                    | otherwise = "unknown"

chooseShift :: String -> [(Char, Char)]
chooseShift s = if (englishProb lefted >= englishProb righted) then left else right
    where lefted = shiftString left $ map toLower s
          righted = shiftString right $ map toLower s

englishProb :: String -> Double
englishProb s = squaredDiff stats
    where stats = map (\a@(x:_) -> (x,normalize $ length a)) . group . sort $ s
          normalize a = (fromIntegral a) / (fromIntegral $ length s)
          squaredDiff p = sum . map ((\x -> x*x) .  diff) . filter isAlpha $ p
          diff (c,v) = abs . (v-) $ lookup' c letterFreq
          isAlpha (a,_) = ord(a) >= 97 && ord(a) <= 122

keyboard :: [String]
keyboard = ["qwertyuiop[]\\", "asdfghjkl;'","zxcvbnm,./"," "]

right :: [(Char,Char)]
right = shiftKeyboardWith shiftR
    where shiftR l = (tail l)++[(head l)]

left :: [(Char,Char)]
left = shiftKeyboardWith shiftL
    where shiftL l = (last l):(init l)

shiftString :: [(Char,Char)] -> String -> String
shiftString m s = map (\c -> shiftChar c m) s

shiftChar :: Char -> [(Char, Char)] -> Char
shiftChar k d = reCast $ (\(Just b) -> b) $ lookup (toLower k) d
    where reCast = if (isUpper k) then toUpper else id

shiftKeyboardWith :: ([Char] -> [Char]) -> [(Char,Char)]
shiftKeyboardWith f = zip (concat keyboard) . concat $ map f keyboard

lookup' :: (Eq a) => a -> [(a,b)] -> b
lookup' k d = (\(Just b) -> b) $ lookup k d

letterFreq :: [(Char, Double)]
letterFreq = [ ('a',8.167)
             , ('b',1.492)
             , ('c',2.782)
             , ('d',4.253)
             , ('e',12.702)
             , ('f',2.228)
             , ('g',2.015)
             , ('h',6.094)
             , ('i',6.966)
             , ('j',0.153)
             , ('k',0.772)
             , ('l',4.025)
             , ('m',2.406)
             , ('n',6.749)
             , ('o',7.507)
             , ('p',1.929)
             , ('q',0.095)
             , ('r',5.987)
             , ('s',6.327)
             , ('t',9.056)
             , ('u',2.758)
             , ('v',0.978)
             , ('w',2.360)
             , ('x',0.150)
             , ('y',1.974)
             , ('z',0.074) ]

Compilation
ghc shift.hs
./shift.hs < inputs

Output
text: You should try typing one to the left.
offset: left
text: I like programming contests.
offset: right
text: Cats and dogs are so passe.
offset: right
text: This contais an arbitarily long word.
offset: left
text: The cat 'n the hat went out to bat.
offset: right
text: If you create a small dictionary of the most common english words then you can check your output for those words; the word 'the' and the word 'and' are unique when offset left and offset right.
offset: left

Python 2.6 390 430 410 408 355 347 354 346 300 chars
Updates:

(Hopefully) fixed a bug with semicolons.
Horrible hack to make the middle row work properly :(
Golfed the hack a bit better
Fixed stupid printing
Realised I can assume left if not right!
Now deals with the whitespace in a much neater way. (after breaking it!)
Trimmed a bit all over
Changed the key condition for left or rightness
Changed some variable names and pruned the lambda
Thanks to Volatility for some much neater ways to do things, and a general golf overhaul (see comments).
Changed the letters it searches for to avoid redundancy (for instance the character r is likely to appear in all shifted sentences).

Golfed with help from Volatility.  Algorithm compares the number of times the characters 'awg and mp;[y appear in the text.  The first set corresponds to aoseh shifted left, the second to anolpt shifted right.  These unshifed letters are highly likely to appear in any sentence (each set should account for ~40% of the letters in a normal sentence) and are indicative of which shift occurred (the shifted letters are unlikely/forbidden to appear in the same sentence when shifted the other way).
To help with choosing which letters to use, I used the frequency of each letter to find the corresponding frequency of characters which appear in shifted sentences using this (slightly golfed for practice) program.
I don't think it handles punctuation very well for instance (commas?).  Please leave comments with failure cases and I'll try to make it more robust :)
Usage
$ program.py
'Put text here with any escape characters if it\'s necessary.'

Code:
s=''.join(dict(zip('|{"?:<',"\['/;,")).get(x,x)for x in input().lower())
h=lambda b:sum(x in b for x in s)
i=h('mpsy;[')>h("'aiwg")
f="  \qwertyuiop[asdfghjkl;'/zxcvbnm,. "
t=''
for x in s:t+=f[f.find(x)+(1,-10)[x=="'a"[i]]*(-1)**i]
print'offset:',('righ','lef')[i]+'t\ntext:',t[:-1].capitalize()+'.'

Explanation:

Ignore uppercase and replace "uppercase" symbols (ie capital "Q" shifted left is "|")
Choose right if any characters from that small set, else right (this actually is sufficient for all the test cases!).  Compare number of indicative 'left' and 'right' characters and chose left or right from this
the shift string is as reduced as possible and as a result doesn't deal with the middle line wrapping around.  2 spaces at the start and 1 at the end deals with the whitespace
deal with ' if shifted left or a if shifted right by offsetting by 10 in the other direction.  whitespace is found at index 0 in s so -1 or +1 match either 2nd or last character in s (both whitespace)
print

Failures:
There are failure cases but the code will work with a very high probability if the sentence hasn't been specifically engineered to break it :)

 Boo proper nouns: "\"b 'ookw dwkk ib Bwqrib;a gw's."
 Right-shifted sentences without the letters anoplt but with some 'fqu
"Wirrmd wirrg ypp." fails whereas "Wirrmd wirrg ypp upi lmpe." succeeds (apologies)
 Left-shifted sentences without the letters aeosh

Here is a bit of golfing I did to your code. It's functionally exactly the same, apart from the use of raw_input(), so you can change it if you want to. It's 301 chars including newlines, and quite legible. ;)

@Volatility that's very cool, I was wondering if there was something I could do with that dict and zip but I've never got round to learning to use zip (this is as good a time as any!).  One criticism: your variables don't spell out anything on the lhs :).  Mind if I update my post with your work (with credit of course)?

Certainly (ie. I don't mind). If you want to, you can change the variable names as well. (Maybe something like s h i f t will do) ;)

Actually I just realised that the last line should have r.capitalize()[:-1] instead of r.capitalize(). That's 306 characters, sorry -.-

You read my mind (re shift) and now it shall appear I've stolen your idea!  Also I don't think *~-0**h works as you expect.  ~-0**n = -1 for all n>0 but ~-0**0 = 0 (for some reason).  I've replaced it with *(1-2*h) which I think is the best alternative... also raw_input doesn't work if the text starts with an escape character - like the one at the bottom of my post

I was just working it out :).  Could shave off 2/4 more if I'm happy only checking for 'e' and 'a's in the sentence.... I'd do just e's but someone might challenge it with "Gatsby was walking back from a visit down in Branton Hill's manufacturing district on a Saturday night..."

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Tips for golfing in Tcl
What general tips do you have for golfing in Tcl? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Tcl (e.g. "remove comments" is not an answer). Please post one tip per answer.

Use lmap instead foreach. This requires Tcl 8.6.
The syntax is the same, but lmap returns a list with the result of each loop.

Subcommands and options can (usually) be abbreviated. This can save quite a bit, but you must test as not everything can be shortened this way (regsub's options can't, for example).
You can then use this with the magic of namespace to do some truly evil things. Consider this:
namespace exp *;namespace en cr -c ?

After that, ? is now a magical command that lets you abbreviate any global Tcl command, and all without the nasty uncertainty of messing around with unknown.

On my answer https://codegolf.stackexchange.com/a/107557/29325 I can demonstrate:

Usually set j 0;while \$j<$n;{...;incr j} is shorter than the equivalent for {set j 0} {$j<$n} {incr j} {...}
When the looping variable begins at 1, we can do the increment as part of the while test condition, avoiding to write before set i 1 unnecessarily: while {[incr i]<=$n} {...} instead of set i 1;while \$i<=$n;{...;incr i}

ATTENTION: One can only do 2. in the case of an outer loop! I could not apply it to my j variable as it needs to be reset to 1 in the outside of its own inner loop! And incr j would acquire the value that was set on the last step of the inner loop, instead of grabbing an undefined variable j to assume 0 and increment it to 1!

Sometimes it is worth to use time {script} n where n is the number of iterations instead of a normal while or for loop. Although time's purpose is not looping, the achieved effect is the same.
I made changes recently to my own answers following this direction.
UPDATE: I've just discovered an easy to fall pitfall: You can not replace a for or a while by a time block, if it contains a break or a continue.

Use the interactive shell. This allows you to abbreviate the command names as long as only 1 command starts with the remaining letters.
Example:

gets -> ge
lassign -> las
expr -> exp
puts -> pu

And interactive solutions are free :P
Background:
When tclsh runs with a terminal as input device, it sets the variable tcl_interactive to 1. This causes unknown (default procedure that will be called if a command can not be found) to search for commands that starts with that name.
Downside: it will print the result of every line, use ; instead of newlines.
Ohh, and it might invoke external commands like w, which is a good abbreviation of while.

else is optional
As it is said on if manual page, else is implicit on if block constructs. So what is
if ... {} else {}
can become
if ... {} {}
as you can see on some of my answers.

I'm using Tcl 8.0.5, but I believe the following are applicable to all recent versions.

Use rename to rename rename:
rename rename &

The & can be any identifier; & just reminds me of "references" in C.
Use the renamed rename to rename set:
& set =

Again, the = can be any identifier; = is just intuitive to me.
Now, rename other commands that are worth renaming, e.g.
& regsub R
& string S
& while W

A command is worth renaming if, given its length n, and occurrences k, k(n-1)-(n+4) > 0. Solving for k, the formula becomes k > (n+4)/(n-1). Here's a reference table that makes it easy:
length of       minimum         example(s)
command         occurrences
------------------------------------------------
2               6               if (consider renaming to "?")
3               4               for, set (consider renaming to "=")
4               3               eval, expr, incr (consider renaming to "+"), info, join, proc, puts, scan
5               3               break, catch, lsort, split, subst, trace, unset, while
6               3               format, lindex, lrange, regexp, regsub, rename, return, string, switch
7               2               foreach, lappend, linsert, llength, lsearch, unknown
.               2               lreplace
.               2               continue
.               2

Next, compact frequently used subcommands like
= I index
= L length

so you can do things like
S $I $x 7
S $L $x

Some obvious miscellanea:

lappend can set the first element of a list if it doesn't yet exist (no need to initialize).
You can set arrays without using array, e.g. set doesNotExist(7) 43.
You can use strings ("a b c") instead of [list a b c].
You can interpolate in strings like so: foo${a}bar.
You can use two\ words rather than "two words". (Remember in general that for contiguous strings without spaces, double quotes can be omitted!)
You can almost always rewrite fors as whiles to save a character or two, since a while can simultaneously check and increment while a for uses separate blocks.

For larger programs, here's a trick I thought of but haven't yet applied:
proc unknown {c args} {eval [info commands $c*] $args}

This emulates interactive command abbreviations! It costs 54 characters, but now you can use j for join, sp for split, st for string, w for while, and so on.

If you want to emulate interactive abbreviations, use info script {};set tcl_interactive 1

Cool, thanks! I've credited you here. There were some issues with that technique, however, that I didn't encounter with the unknown route: see here and here.

The question asks for tips which are somewhat specific to Tcl. The ternary operator is included in the tips for all languages.

May be it should be integrated on another answer, but here it goes:
When a proc has only one parameter it could be written as
proc p a {DO THINGS}

instead of
proc p {a} {DO THINGS}

The same applies to a two parameters proc using a backslash; it can be written as
proc p a\ b {DO THINGS}

instead of
proc p {a b} {DO THINGS}

For an higher number of parameters the {} render shorter code.

Sometimes it is worth to replace the two set statements to concatenate strings by only one lappend statement. On a construction like, one can substitute
set s ""

loop {
    # ...
    set s $s\X
}

by
loop {
    # ...
    append s X
}

The append command has an incr like behaviour, which initializes a not yet defined variable.
Take care to not mistake append by lappend

If you are handling a list with an operation that syntactically is interleaving between each element, sometimes you can join elements to do a specific operation, instead of traversing it.
On https://codegolf.stackexchange.com/a/127042/29325 there is an example:
puts \n[expr [join [split [read stdin]] +]]

It read stdin gives 23 214 52 then split will give the list {23 214 52}. After, [join {23 214 52} +] will return the string 23+214+52. Finally expr 23+214+52 does the job of summing

In this case, you can omit the split.

If you have large codes, it's possible to avoid multiple usages of expr using namespace pat tcl::mathop at the beginning. It provides prefix-syntax operation as a regular Tcl fonction. For example:
namespace pat tcl::mathop
set sum [+ 1 2 3]
set prod [* {*}{1 2 3 4}]
puts $sum\ $prod

See official mathop doc page

When you have several variables that are been set on subsequent lines you can use one lassign instead of several set instructions to achieve the same effect.
One example is my own answer https://codegolf.stackexchange.com/a/105789/29325
To decide, one just needs to weight the number of variables (assuming 1 letter variables, as it is expected when golfing):

<5, set is golfier
=5, set and lassign generate the same byte count
>5, lassign is golfier

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Write a Polish notation interpreter, then change it to RPN in shortest number of chars
Write a program to convert Polish prefix notation to infix notation, then change it to an RPN-to-infix converter in the shortest number of chars.
Your score is 100 minus the number of characters changed, added and deleted.

Don't write one PPN and one RPN function, then do something like:
"I changed rpn(raw_input()) to ppn(raw_input())"
No ingenious variations of the above rule such as
def f(s, rpn = False):
if rpn:
    #rpn logic here
else:
    #ppn logic here

In short, your program must only implement one kind of logic, not both.
It must not be possible to only delete characters from the original program and so obtain a program which converts RPN to infix.
Try not to use inbuilt libraries.
Accept input from STDIN or from a file.
Note that program length itself does not matter.
Have fun.

Anyone who doesn't score 100 isn't really trying. The only way I can see to draw a clear line which prevents that is to say something along the lines of "It must not be possible to delete characters from the original program and so obtain a program which converts RPN to infix".

Could you explain why? Besides, deleted chars also count.

If the first token is a number, it's RPN: otherwise it's PPN. Dead easy to detect.

@PeterTaylor Even the "delete characters" version can be hacked. Simply encode your program using any non-basic scheme and add the decoding code - you can't remove any characters without breaking the program.

The (first sentence of the) description doesn't match the title.

Why not? /10char

The last tip doesn't matter, as long as you use the same code in both it won't modify your score.

Python - 100!
I'm pretty sure I've met all the criteria. I don't think its possible to make it more identical, without just having a big ol' if block, which would violate the criteria. Using cmp(), and what @PeterTaylor pointed out you can determine the direction you need to go. Rather than use an if/then which would violate the spirit of the challenge, this get the position of the first number and operator and compares those. While the list comprehensions use an if this is just to safely filter the indices and doesn't direct help determine if we are doing forward or reverse polish notation, but this does bend the rules a bit.
Rule-bending program: Both prefix and reverse Polish notation
s = raw_input().strip()                          # Get input
ops = "*-+/^"                                    # A string of operators
num="0123456789"                                 # A string of numbers
p_num= min([s.index(n) for n in num if n in s])  # Find the first number
p_op = min([s.index(o) for o in ops if o in s])  # Find the first operator
                                                 # We use the above 2 lines to determine what
                                                 #   direction we are going on line '2' below

                          #  Just like the original below
s=s.split()                  #  1. Split the input
d = cmp(p_op,p_num)          #  2. Set the direction... depending on what comes first!
                             #     If the first number is before the operator, go forwards
                             #     If the first number is after the operator, go backwards
def f(i):                    #  3. Define our recursive function
 if s[i] in operators:       #  4. If its an operator...
  a = f(i+d)                 #  5.  Recursively get the first argument
  b = f(i+d)                 #  6.  By the time the above is resolved the array is modified
                             #     So we can use the same offset
  c = [a,b,a]                #  7. Mash these in a padded array so the trick below works
  inf = c[d-1]+s.pop(i)+c[d] #  8. Lets put these in order... BASED ON d!!
                             #      And remove the operator from the array
  return "("+inf+")"         #  9. Return the infix version of this operator
 return s.pop(i)             # 10. Just a number?, pop and return.
print f([0,-1,42][d-1])      # 11. Call the recursive start case from the head of the array
                             #    i.e element 0, or just 0.
                             #    Print the final infix

If the above is too rule bendy, here is the code I had before that scored 99.
Original program: Polish prefix notation
s = raw_input().split(" ")   #  1. Get input
d = 1                         # 2. Set the direction to forwards
                             #     If the first number is before the operator, go forwards
                             #     If the first number is after the operator, go backwards
def f(i):                    #  3. Define our recursive function
 if s[i] in operators:       #  4. If its an operator...
  a = f(i+d)                 #  5.  Recursively get the first argument
  b = f(i+d)                 #  6.  By the time the above is resolved the array is modified
                             #     So we can use the same offset
  c = [a,b,a]                #  7. Mash these in a padded array so the trick below works
  inf = c[d-1]+s.pop(i)+c[d] #  8. Lets put these in order... BASED ON d!!
                             #      And remove the operator from the array
  return "("+inf+")"         #  9. Return the infix version of this operator
 return s.pop(i)             # 10. Just a number?, pop and return.
print f([0,-1,42][d-1])      # 11. Call the recursive start case from the head of the array
                             #    i.e element 0, or just 0.
                             #    Print the final infix

Modified to produce: Reverse polish notation
s = raw_input().split(" ")
d = -1                        # 2. Set the direction to backwards
def f(i):
 if s[i] in "*-+/^":
  a = f(i+d)
  b = f(i+d)
  c = [a,b,a]
  inf = c[d-1]+s.pop(i)+c[d]
  return "("+inf+")"
 return s.pop(i)
print f([0,-1,42][d-1])       #11. No change, but this pulls the second last (-2) element
                              #    Hence, why we bump it to 3 elements long.

Differences (not including the comments):

Line 2: 1 char, added - to change from +1 to -1

For a total of 1 character changed, which in Polish notation, gives
- 100 1 = 99

- 100 1 = 99 was the icing on the cake. Nice answer, and seeing how this is the best possible...


text:
letter combinations to make words
Find the combination of N number of letters that make up the most words of length N.
For example:
n r u  ->  run, urn
dstu -> dust, stud
(these are just examples, not the best combination of 3,4 length sets of letters)

The challenge in the case is to start with length N=3 and end at N=11. Which combination of letters gives you the most words and what are those words?
For the contest, please use this word list. It contains 71,193 words.  Please also let us know the time (in seconds) and CPU type/speed that you are using.

How do you score the results? Your question seems to imply that execution time is important, but is is more important than code size?

Code size is most imporatnt, time is just a curiosity.

k (39)
Expects the wordlist to be in a file called w in the current directory.
{i?max i:#:'=:{x@<x}'(w@=:#:'w:0:`:w)x}

Example usage (calculating result for every permissible input, runs in 640 ms on single core of Pentium E2160)
k){i?max i:#:'=:{x@<x}'(w@=:#:'w:0:`:w)x}'3+!9
("AET";"AELS";"AELST";"ACERST";"ADEEGNR";"AEGILNRT";"AACEINRST";"ADIIMNNOOT";..

Ruby, 116 97 92 characters
9.times{|n|p IO.read('w').split.group_by{|s|s.chars.sort}.max_by{|k,v|k.size!=n+3?0:v.size}}

The wordlist is expected in the file w in the local directory. Program runs less than a second.
Output:
[["A", "E", "T"], ["ATE", "EAT", "ETA", "TAE", "TEA"]]
[["A", "E", "L", "S"], ["ALES", "ELSA", "LEAS", "LESA", "SALE", "SEAL"]]
[["A", "E", "L", "S", "T"], ["LEAST", "SLATE", "STAEL", "STALE", "STEAL", "TALES", "TEALS", "TESLA"]]
[["A", "C", "E", "R", "S", "T"], ["CARETS", "CASTER", "CATERS", "CRATES", "REACTS", "RECAST", "TRACES"]]
[["A", "D", "E", "E", "G", "N", "R"], ["ANGERED", "DERANGE", "ENRAGED", "GRANDEE", "GRENADE"]]
[["A", "E", "G", "I", "L", "N", "R", "T"], ["ALERTING", "ALTERING", "INTEGRAL", "RELATING", "TRIANGLE"]]
[["A", "A", "C", "E", "I", "N", "R", "S", "T"], ["ASCERTAIN", "CARTESIAN", "SECTARIAN"]]
[["A", "D", "I", "I", "M", "N", "N", "O", "O", "T"], ["ADMONITION", "DOMINATION"]]
[["A", "C", "G", "H", "I", "I", "L", "M", "O", "R", "T"], ["ALGORITHMIC", "LOGARITHMIC"]]

Your solution does not return all correct results. For example, you only list {O,P,S,T} for four letters.  {A,L,E,S} and {A,T,E,S} are also correct answers.

@DavidCarraher, the spec doesn't ask for more than one answer. It uses a singular noun more than once.

Your combinations contain repeated characters (are not sets). I can't see how a combination of a bag makes sense.

@Griffin, why not? Mathematical literature tends to be careful enough to say "combinations without repetitions" or "combinations with repetitions", but in this context it seems reasonable to understand "combinations with repetitions" (and all four current answers do).

How does one distinguish between {a,a} and {a,a} ?

Btw, combinations are defined on sets.

@Griffin I do not understand what you mean by your remark concerning distinguishability. Why do we need it for this question? And as PeterTaylor said - it makes complete sense to assume combination with repetition in this context.

@Griffin, you don't distinguish between them. That's the point.

Haskell, 341 chars
Takes the word list on standard input, and return all possible solutions for each 2 < n < 12 a quadruple of the form:
(n, s, l, w)

where
n = Selected number of letter (between 3 and 11)
s = Size of the biggest sets of words of given size
l = The ordered sets of letters that compose words
w = The sets of words for each set of letters

for example: (3,5,["AET"],[["ATE","EAT","ETA","TAE","TEA"]])
Compressed code
import Data.List;import Data.Function;main=do interact$unlines.map(show.(\x->(length.head.head$x,length.head$x,map(sort.head)$x,x)).last.groupBy((==)`on`length).sortBy(compare`on`length)).groupBy((==)`on`(length.head)).sortBy(compare`on`(length.head)).groupBy((==)`on`sort).sortBy(compare`on`sort).filter(\x->length x>=3&&length x<=11).lines

A bit more readable code
import Data.List
import Data.Function

main = do
    interact $ unlines . map ( show . (\x -> (length . head . head $ x, length . head $ x, map (sort . head) $ x, x)) . last . groupBy ((==) `on`length) . sortBy (compare `on` length)) . groupBy ((==) `on` (length . head)) . sortBy (compare `on ` (length . head)) . groupBy ((==) `on` sort) . sortBy (compare `on` sort) . filter (\x -> length x >= 3 && length x <= 11) . lines

Execution
Compiling with: ghc -O2 letter.hs
Running with: time ./letter < wordlist
Result: 1.75s user 0.03s system 99% cpu 1.784 total
CPU info: Intel i7 8x3.4 GHz 64 bits
Output
(3,5,["AET"],[["ATE","EAT","ETA","TAE","TEA"]])
(4,6,["AELS","AEST","OPST"],[["ALES","ELSA","LEAS","LESA","SALE","SEAL"],["ATES","EAST","EATS","SATE","SEAT","TEAS"],["OPTS","POST","POTS","SPOT","STOP","TOPS"]])
(5,8,["AELST"],[["LEAST","SLATE","STAEL","STALE","STEAL","TALES","TEALS","TESLA"]])
(6,7,["ACERST"],[["CARETS","CASTER","CATERS","CRATES","REACTS","RECAST","TRACES"]])
(7,5,["ACDEILM","ADEEGNR","ADEHRST","ADEIRST","AEIRSTT","AELPRSY","EIPRSST"],[["CLAIMED","DECIMAL","DECLAIM","MALICED","MEDICAL"],["ANGERED","DERANGE","ENRAGED","GRANDEE","GRENADE"],["DEARTHS","HARDEST","HATREDS","THREADS","TRASHED"],["ARIDEST","ASTRIDE","STAIDER","TARDIES","TIRADES"],["ARTIEST","ARTISTE","ATTIRES","IRATEST","TASTIER"],["PARLEYS","PARSLEY","PLAYERS","REPLAYS","SPARELY"],["PERSIST","PRIESTS","SPRIEST","SPRITES","STRIPES"]])
(8,5,["AEGILNRT","AEGINRST"],[["ALERTING","ALTERING","INTEGRAL","RELATING","TRIANGLE"],["ANGRIEST","GANTRIES","INGRATES","RANGIEST","TANGIERS"]])
(9,3,["AACEINRST","ABEEILRST","ACDEINOTU","ACEGINRRT","ACEINSSTT","ADEGGINNR","ADEGINRRW","AEEGNRSST","AEGHILNRT","AEGIMNRST","AEILMSTTU","CEINORSTU","DEEINRSST","EGIILNNST","EGIINPRRS","EGINORRST"],[["ASCERTAIN","CARTESIAN","SECTARIAN"],["BEASTLIER","BLEARIEST","LIBERATES"],["AUCTIONED","CAUTIONED","EDUCATION"],["CRATERING","RETRACING","TERRACING"],["CATTINESS","SCANTIEST","TACITNESS"],["DANGERING","DERANGING","GARDENING"],["REDRAWING","REWARDING","WARDERING"],["ESTRANGES","GREATNESS","SERGEANTS"],["EARTHLING","HALTERING","LATHERING"],["EMIGRANTS","MASTERING","STREAMING"],["MUTILATES","STIMULATE","ULTIMATES"],["COUNTRIES","CRETINOUS","NEUROTICS"],["DISSENTER","RESIDENTS","TIREDNESS"],["ENLISTING","LISTENING","TINSELING"],["REPRISING","RESPIRING","SPRINGIER"],["RESORTING","RESTORING","ROSTERING"]])
(10,2,["AAAILNRSTU","AABEIILNST","AACDEGLOTU","AACEGLOSTU","AACEINRSST","AAEILNORST","AAEINOPRRT","AAGILLMNRY","AAGINNOSTT","ABDDEIORSS","ACCEHIMSST","ACDEEILNRT","ACDEGIIMNT","ACDEIIMNOT","ACDEIIPRST","ACDEINOORT","ACEEILMSST","ACEEINNRST","ACEEINRSST","ACEGHINRTT","ACEIINOTTX","ACEILNOSST","ACGIINNOTU","ACGILLNOPS","ADEEGINNRS","ADEEHILPRS","ADEEIMNNOT","ADEEINRSTT","ADEEINRSTU","ADEFORRSTW","ADEGIILMNS","ADEILPSTTU","ADEINNOOTT","ADIIMNNOOT","AEEGIMNPRT","AEEGINNRST","AEEGINNRTV","AEEHILRSTT","AEEHINRSST","AEEHORSSUW","AEEINNORTV","AEEIPRSSTT","AEEMNSSTTT","AEGHILNRST","AEGHINRSTT","AEGIINNPRT","AEGINRRSTT","AEHIRSSTTW","AEIILORSST","AFIILNORTT","AGHILMORST","AGIILMNTTU","AIILNOOPST","BDEGILNORU","BEGILNORST","CCEEGHIKNR","CCEEGINORT","CCEGINNORT","CDDEINOSTU","CDEEIINRST","CDEEIORRSV","CDEEMOPRSS","CDEEOPRRSU","CDEGIINNRS","CDEIINORST","CDEIINRSTT","CDEINORSTU","CEFGIINRTY","CEFGINORSU","CEGHIIKNNT","CEGINNNOTT","CEGINNORSV","CEGINNORTU","CEIINNOPST","CEINOPRSSU","DEEEINNRTV","DEEEIPRSTX","DEEELOPRSV","DEEFIILNRS","DEEFORRSST","DEEIMNORSZ","DEGILNOSTU","DEGINNRSSU","DEIINOOPST","EEGINNPRST","EEGLNORSTT","EEIIMPRSSV","EEIINOPRTT","EEINPRSSTT","EELOPRSSTY","EFIMNORSTU","EGIINPRSST","EGILMNOOSS","EIIMNOPRSS","EIMNNRSTTU","EIMNOPRSTU","GHILOPSSTT"],[["AUSTRALIAN","SATURNALIA"],["BANALITIES","INSATIABLE"],["CATALOGUED","COAGULATED"],["CATALOGUES","COAGULATES"],["ASCERTAINS","SECTARIANS"],["RATIONALES","SENATORIAL"],["PRAETORIAN","REPARATION"],["ALARMINGLY","MARGINALLY"],["ANTAGONIST","STAGNATION"],["BROADSIDES","SIDEBOARDS"],["CATECHISMS","SCHEMATICS"],["CREDENTIAL","INTERLACED"],["DECIMATING","MEDICATING"],["DECIMATION","MEDICATION"],["PATRICIDES","PEDIATRICS"],["COORDINATE","DECORATION"],["CLEMATISES","TIMESCALES"],["NECTARINES","TRANSIENCE"],["ANCESTRIES","RESISTANCE"],["CHATTERING","RATCHETING"],["EXCITATION","INTOXICATE"],["COASTLINES","SECTIONALS"],["AUCTIONING","CAUTIONING"],["COLLAPSING","SCALLOPING"],["GRENADINES","SERENADING"],["DEALERSHIP","LEADERSHIP"],["DENOMINATE","EMENDATION"],["REINSTATED","STRAITENED"],["UNREADIEST","UNSTEADIER"],["AFTERWORDS","FORWARDEST"],["MISDEALING","MISLEADING"],["PLATITUDES","STIPULATED"],["DENOTATION","DETONATION"],["ADMONITION","DOMINATION"],["IMPREGNATE","PERMEATING"],["ARGENTINES","TANGERINES"],["ENERVATING","VENERATING"],["EARTHLIEST","STEALTHIER"],["EARTHINESS","HEARTINESS"],["HOUSEWARES","WAREHOUSES"],["ENERVATION","VENERATION"],["STRIPTEASE","TAPESTRIES"],["STATEMENTS","TESTAMENTS"],["EARTHLINGS","SLATHERING"],["SHATTERING","STRAIGHTEN"],["PERTAINING","REPAINTING"],["REGISTRANT","RESTARTING"],["SWARTHIEST","SWEATSHIRT"],["SOLITAIRES","SOLITARIES"],["FILTRATION","FLIRTATION"],["ALGORITHMS","LOGARITHMS"],["MUTILATING","ULTIMATING"],["POSITIONAL","SPOLIATION"],["BOULDERING","REDOUBLING"],["BOLSTERING","LOBSTERING"],["CHECKERING","RECHECKING"],["EGOCENTRIC","GEOCENTRIC"],["CONCERTING","CONCRETING"],["DEDUCTIONS","DISCOUNTED"],["INDISCREET","IRIDESCENT"],["DISCOVERER","REDISCOVER"],["COMPRESSED","DECOMPRESS"],["PROCEDURES","REPRODUCES"],["DISCERNING","RESCINDING"],["DIRECTIONS","DISCRETION"],["DISTINCTER","INTERDICTS"],["INTRODUCES","REDUCTIONS"],["CERTIFYING","RECTIFYING"],["CONFIGURES","REFOCUSING"],["KITCHENING","THICKENING"],["CONTENTING","CONTINGENT"],["CONSERVING","CONVERSING"],["COUNTERING","RECOUNTING"],["INCEPTIONS","INSPECTION"],["PERCUSSION","SUPERSONIC"],["INTERVENED","REINVENTED"],["EXPEDITERS","PREEXISTED"],["DEVELOPERS","REDEVELOPS"],["FRIENDLIES","INFIELDERS"],["DEFROSTERS","FORTRESSED"],["MODERNIZES","SERMONIZED"],["LONGITUDES","UNGODLIEST"],["UNDERSIGNS","UNDRESSING"],["DEPOSITION","POSITIONED"],["PRESENTING","SERPENTING"],["LONGSTREET","LORGNETTES"],["IMPRESSIVE","PERMISSIVE"],["PETITIONER","REPETITION"],["PERSISTENT","PRETTINESS"],["POLYESTERS","PROSELYTES"],["MISFORTUNE","UNIFORMEST"],["PERSISTING","SPRINGIEST"],["GLOOMINESS","NEOLOGISMS"],["IMPRESSION","PERMISSION"],["INSTRUMENT","NUTRIMENTS"],["IMPORTUNES","RESUMPTION"],["SPOTLIGHTS","STOPLIGHTS"]])
(11,2,["AABCDEORRST","AACGGILNOTU","AACGHILLPRY","AAEIILNORTZ","AAEILMNPRST","ABCEEEILRSV","ABCEEFIILRT","ACDEEINORST","ACDEFIIINOT","ACDEINOORST","ACEEIIPPRTT","ACEINOOPRRT","ACGHIILMORT","ACIILLNOOST","ADEEILMNRST","ADEEIMNNOST","ADEIINOPRTT","ADEINNOOSTT","AEEIIMPRSTV","AEEILNTTTVY","AEEIMNNORTU","AEGHILNOOST","AEGIINNORTT","AEGIINNRSTT","AEIMNOPRTTU","CDEEEOPRRSS","CDEEIORRSSV","CDEIINNOORT","CDEIINOPRST","DEEFIIINNST","EEEINPRRSST","EEEIOPRRRST","EEGIINNNRTV","EEHLOPRRSTU","EEIINOPRSTT","EIIMNOPRSSS"],[["BROADCASTER","REBROADCAST"],["CATALOGUING","COAGULATING"],["CALLIGRAPHY","GRAPHICALLY"],["RATIONALIZE","REALIZATION"],["PARLIAMENTS","PATERNALISM"],["RECEIVABLES","SERVICEABLE"],["CERTIFIABLE","RECTIFIABLE"],["CONSIDERATE","DESECRATION"],["DEIFICATION","EDIFICATION"],["COORDINATES","DECORATIONS"],["PERIPATETIC","PRECIPITATE"],["INCORPORATE","PROCREATION"],["ALGORITHMIC","LOGARITHMIC"],["COLONIALIST","OSCILLATION"],["DERAILMENTS","STREAMLINED"],["DENOMINATES","EMENDATIONS"],["PARTITIONED","TREPIDATION"],["DENOTATIONS","DETONATIONS"],["IMPERATIVES","SEMIPRIVATE"],["ATTENTIVELY","TENTATIVELY"],["ENUMERATION","MOUNTAINEER"],["ANTHOLOGIES","THEOLOGIANS"],["INTEGRATION","ORIENTATING"],["REINSTATING","STRAITENING"],["IMPORTUNATE","PERMUTATION"],["PREDECESSOR","REPROCESSED"],["DISCOVERERS","REDISCOVERS"],["CONDITIONER","RECONDITION"],["DESCRIPTION","PREDICTIONS"],["INDEFINITES","INTENSIFIED"],["ENTERPRISES","INTERSPERSE"],["REPERTOIRES","REPERTORIES"],["INTERVENING","REINVENTING"],["REUPHOLSTER","UPHOLSTERER"],["PETITIONERS","REPETITIONS"],["IMPRESSIONS","PERMISSIONS"]])

GolfScript (53 chars)
n/{[.$\]}%$'']({.1<2$<{1>+}*}/]9,{3+\{(,2$=*,}$)p}/];

or
n/{[.$\]}%$'']({.1<2$<{1>+}*}/]3{\{(,2$=*,}$)p\)}9*;;

I assume that there is at least one word of each length in the range processed: otherwise things will go badly wrong.
["AET" "ATE" "EAT" "ETA" "TAE" "TEA"]
["AELS" "ALES" "ELSA" "LEAS" "LESA" "SALE" "SEAL"]
["AELST" "LEAST" "SLATE" "STAEL" "STALE" "STEAL" "TALES" "TEALS" "TESLA"]
["ACERST" "CARETS" "CASTER" "CATERS" "CRATES" "REACTS" "RECAST" "TRACES"]
["ADEEGNR" "ANGERED" "DERANGE" "ENRAGED" "GRANDEE" "GRENADE"]
["AEGINRST" "ANGRIEST" "GANTRIES" "INGRATES" "RANGIEST" "TANGIERS"]
["AACEINRST" "ASCERTAIN" "CARTESIAN" "SECTARIAN"]
["EEINPRSSTT" "PERSISTENT" "PRETTINESS"]
["EEIINOPRSTT" "PETITIONERS" "REPETITIONS"]

Took about 2 minutes on my 2GHz 64-bit CPU.

The present answer fails to list all solutions.

@DavidCarraher, see my previous answer to this comment.

Mathematica 192
A bit wordy, but it returns multiple correct answers for the same word length (when they exist):
w = Flatten[Characters@Import["words.txt", "Data"], 1];
Table[Cases[#, {x_, Max[#[[All, -1]]]} :> {Characters@x[[1]], x}] &[{StringJoin /@ #,
Length[#]} & /@ GatherBy[Select[w, Length[#] == k &], Sort[#1] &]], {k, 3, 11}]

Timing: 1.228453 s; 2.8 GHz Intel i7 Mac OS X 10.8.3
Results for lengths 3-9 are displayed below.  There are too many winning combinations for sets of 10, 11 letters to be displayed here.

J (96)
(echo@(((~.#~([=>./)@(#/.~))="0/[)@:((/:{[)&.>)#[)@((LF cut 1!:1[3)&([#~]=>@(#&.>)@[)))&.>3+i.9

It runs in a few seconds on my 2Ghz Pentium 4. It expects the wordlist on stdin, i.e. cat wordlist | jconsole combinations.ijs
Output:

┌───┬───┬───┬───┬───┐
│ATE│EAT│ETA│TAE│TEA│
└───┴───┴───┴───┴───┘
┌────┬────┬────┬────┬────┬────┐
│ALES│ELSA│LEAS│LESA│SALE│SEAL│
├────┼────┼────┼────┼────┼────┤
│ATES│EAST│EATS│SATE│SEAT│TEAS│
├────┼────┼────┼────┼────┼────┤
│OPTS│POST│POTS│SPOT│STOP│TOPS│
└────┴────┴────┴────┴────┴────┘
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│LEAST│SLATE│STAEL│STALE│STEAL│TALES│TEALS│TESLA│
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐
│CARETS│CASTER│CATERS│CRATES│REACTS│RECAST│TRACES│
└──────┴──────┴──────┴──────┴──────┴──────┴──────┘
┌───────┬───────┬───────┬───────┬───────┐
│ANGERED│DERANGE│ENRAGED│GRANDEE│GRENADE│
├───────┼───────┼───────┼───────┼───────┤
│ARIDEST│ASTRIDE│STAIDER│TARDIES│TIRADES│
├───────┼───────┼───────┼───────┼───────┤
│ARTIEST│ARTISTE│ATTIRES│IRATEST│TASTIER│
├───────┼───────┼───────┼───────┼───────┤
│CLAIMED│DECIMAL│DECLAIM│MALICED│MEDICAL│
├───────┼───────┼───────┼───────┼───────┤
│DEARTHS│HARDEST│HATREDS│THREADS│TRASHED│
├───────┼───────┼───────┼───────┼───────┤
│PARLEYS│PARSLEY│PLAYERS│REPLAYS│SPARELY│
├───────┼───────┼───────┼───────┼───────┤
│PERSIST│PRIESTS│SPRIEST│SPRITES│STRIPES│
└───────┴───────┴───────┴───────┴───────┘
┌────────┬────────┬────────┬────────┬────────┐
│ALERTING│ALTERING│INTEGRAL│RELATING│TRIANGLE│
├────────┼────────┼────────┼────────┼────────┤
│ANGRIEST│GANTRIES│INGRATES│RANGIEST│TANGIERS│
└────────┴────────┴────────┴────────┴────────┘
┌─────────┬─────────┬─────────┐
│ASCERTAIN│CARTESIAN│SECTARIAN│
├─────────┼─────────┼─────────┤
│AUCTIONED│CAUTIONED│EDUCATION│
├─────────┼─────────┼─────────┤
│BEASTLIER│BLEARIEST│LIBERATES│
├─────────┼─────────┼─────────┤
│CATTINESS│SCANTIEST│TACITNESS│
├─────────┼─────────┼─────────┤
│COUNTRIES│CRETINOUS│NEUROTICS│
├─────────┼─────────┼─────────┤
│CRATERING│RETRACING│TERRACING│
├─────────┼─────────┼─────────┤
│DANGERING│DERANGING│GARDENING│
├─────────┼─────────┼─────────┤
│DISSENTER│RESIDENTS│TIREDNESS│
├─────────┼─────────┼─────────┤
│EARTHLING│HALTERING│LATHERING│
├─────────┼─────────┼─────────┤
│EMIGRANTS│MASTERING│STREAMING│
├─────────┼─────────┼─────────┤
│ENLISTING│LISTENING│TINSELING│
├─────────┼─────────┼─────────┤
│ESTRANGES│GREATNESS│SERGEANTS│
├─────────┼─────────┼─────────┤
│MUTILATES│STIMULATE│ULTIMATES│
├─────────┼─────────┼─────────┤
│REDRAWING│REWARDING│WARDERING│
├─────────┼─────────┼─────────┤
│REPRISING│RESPIRING│SPRINGIER│
├─────────┼─────────┼─────────┤
│RESORTING│RESTORING│ROSTERING│
└─────────┴─────────┴─────────┘
┌──────────┬──────────┐
│ADMONITION│DOMINATION│
├──────────┼──────────┤
│AFTERWORDS│FORWARDEST│
├──────────┼──────────┤
│ALARMINGLY│MARGINALLY│
├──────────┼──────────┤
│ALGORITHMS│LOGARITHMS│
├──────────┼──────────┤
│ANCESTRIES│RESISTANCE│
├──────────┼──────────┤
│ANTAGONIST│STAGNATION│
├──────────┼──────────┤
│ARGENTINES│TANGERINES│
├──────────┼──────────┤
│ASCERTAINS│SECTARIANS│
├──────────┼──────────┤
│AUCTIONING│CAUTIONING│
├──────────┼──────────┤
│AUSTRALIAN│SATURNALIA│
├──────────┼──────────┤
│BANALITIES│INSATIABLE│
├──────────┼──────────┤
│BOLSTERING│LOBSTERING│
├──────────┼──────────┤
│BOULDERING│REDOUBLING│
├──────────┼──────────┤
│BROADSIDES│SIDEBOARDS│
├──────────┼──────────┤
│CATALOGUED│COAGULATED│
├──────────┼──────────┤
│CATALOGUES│COAGULATES│
├──────────┼──────────┤
│CATECHISMS│SCHEMATICS│
├──────────┼──────────┤
│CERTIFYING│RECTIFYING│
├──────────┼──────────┤
│CHATTERING│RATCHETING│
├──────────┼──────────┤
│CHECKERING│RECHECKING│
├──────────┼──────────┤
│CLEMATISES│TIMESCALES│
├──────────┼──────────┤
│COASTLINES│SECTIONALS│
├──────────┼──────────┤
│COLLAPSING│SCALLOPING│
├──────────┼──────────┤
│COMPRESSED│DECOMPRESS│
├──────────┼──────────┤
│CONCERTING│CONCRETING│
├──────────┼──────────┤
│CONFIGURES│REFOCUSING│
├──────────┼──────────┤
│CONSERVING│CONVERSING│
├──────────┼──────────┤
│CONTENTING│CONTINGENT│
├──────────┼──────────┤
│COORDINATE│DECORATION│
├──────────┼──────────┤
│COUNTERING│RECOUNTING│
├──────────┼──────────┤
│CREDENTIAL│INTERLACED│
├──────────┼──────────┤
│DEALERSHIP│LEADERSHIP│
├──────────┼──────────┤
│DECIMATING│MEDICATING│
├──────────┼──────────┤
│DECIMATION│MEDICATION│
├──────────┼──────────┤
│DEDUCTIONS│DISCOUNTED│
├──────────┼──────────┤
│DEFROSTERS│FORTRESSED│
├──────────┼──────────┤
│DENOMINATE│EMENDATION│
├──────────┼──────────┤
│DENOTATION│DETONATION│
├──────────┼──────────┤
│DEPOSITION│POSITIONED│
├──────────┼──────────┤
│DEVELOPERS│REDEVELOPS│
├──────────┼──────────┤
│DIRECTIONS│DISCRETION│
├──────────┼──────────┤
│DISCERNING│RESCINDING│
├──────────┼──────────┤
│DISCOVERER│REDISCOVER│
├──────────┼──────────┤
│DISTINCTER│INTERDICTS│
├──────────┼──────────┤
│EARTHINESS│HEARTINESS│
├──────────┼──────────┤
│EARTHLIEST│STEALTHIER│
├──────────┼──────────┤
│EARTHLINGS│SLATHERING│
├──────────┼──────────┤
│EGOCENTRIC│GEOCENTRIC│
├──────────┼──────────┤
│ENERVATING│VENERATING│
├──────────┼──────────┤
│ENERVATION│VENERATION│
├──────────┼──────────┤
│EXCITATION│INTOXICATE│
├──────────┼──────────┤
│EXPEDITERS│PREEXISTED│
├──────────┼──────────┤
│FILTRATION│FLIRTATION│
├──────────┼──────────┤
│FRIENDLIES│INFIELDERS│
├──────────┼──────────┤
│GLOOMINESS│NEOLOGISMS│
├──────────┼──────────┤
│GRENADINES│SERENADING│
├──────────┼──────────┤
│HOUSEWARES│WAREHOUSES│
├──────────┼──────────┤
│IMPORTUNES│RESUMPTION│
├──────────┼──────────┤
│IMPREGNATE│PERMEATING│
├──────────┼──────────┤
│IMPRESSION│PERMISSION│
├──────────┼──────────┤
│IMPRESSIVE│PERMISSIVE│
├──────────┼──────────┤
│INCEPTIONS│INSPECTION│
├──────────┼──────────┤
│INDISCREET│IRIDESCENT│
├──────────┼──────────┤
│INSTRUMENT│NUTRIMENTS│
├──────────┼──────────┤
│INTERVENED│REINVENTED│
├──────────┼──────────┤
│INTRODUCES│REDUCTIONS│
├──────────┼──────────┤
│KITCHENING│THICKENING│
├──────────┼──────────┤
│LONGITUDES│UNGODLIEST│
├──────────┼──────────┤
│LONGSTREET│LORGNETTES│
├──────────┼──────────┤
│MISDEALING│MISLEADING│
├──────────┼──────────┤
│MISFORTUNE│UNIFORMEST│
├──────────┼──────────┤
│MODERNIZES│SERMONIZED│
├──────────┼──────────┤
│MUTILATING│ULTIMATING│
├──────────┼──────────┤
│NECTARINES│TRANSIENCE│
├──────────┼──────────┤
│PATRICIDES│PEDIATRICS│
├──────────┼──────────┤
│PERCUSSION│SUPERSONIC│
├──────────┼──────────┤
│PERSISTENT│PRETTINESS│
├──────────┼──────────┤
│PERSISTING│SPRINGIEST│
├──────────┼──────────┤
│PERTAINING│REPAINTING│
├──────────┼──────────┤
│PETITIONER│REPETITION│
├──────────┼──────────┤
│PLATITUDES│STIPULATED│
├──────────┼──────────┤
│POLYESTERS│PROSELYTES│
├──────────┼──────────┤
│POSITIONAL│SPOLIATION│
├──────────┼──────────┤
│PRAETORIAN│REPARATION│
├──────────┼──────────┤
│PRESENTING│SERPENTING│
├──────────┼──────────┤
│PROCEDURES│REPRODUCES│
├──────────┼──────────┤
│RATIONALES│SENATORIAL│
├──────────┼──────────┤
│REGISTRANT│RESTARTING│
├──────────┼──────────┤
│REINSTATED│STRAITENED│
├──────────┼──────────┤
│SHATTERING│STRAIGHTEN│
├──────────┼──────────┤
│SOLITAIRES│SOLITARIES│
├──────────┼──────────┤
│SPOTLIGHTS│STOPLIGHTS│
├──────────┼──────────┤
│STATEMENTS│TESTAMENTS│
├──────────┼──────────┤
│STRIPTEASE│TAPESTRIES│
├──────────┼──────────┤
│SWARTHIEST│SWEATSHIRT│
├──────────┼──────────┤
│UNDERSIGNS│UNDRESSING│
├──────────┼──────────┤
│UNREADIEST│UNSTEADIER│
└──────────┴──────────┘
┌───────────┬───────────┐
│ALGORITHMIC│LOGARITHMIC│
├───────────┼───────────┤
│ANTHOLOGIES│THEOLOGIANS│
├───────────┼───────────┤
│ATTENTIVELY│TENTATIVELY│
├───────────┼───────────┤
│BROADCASTER│REBROADCAST│
├───────────┼───────────┤
│CALLIGRAPHY│GRAPHICALLY│
├───────────┼───────────┤
│CATALOGUING│COAGULATING│
├───────────┼───────────┤
│CERTIFIABLE│RECTIFIABLE│
├───────────┼───────────┤
│COLONIALIST│OSCILLATION│
├───────────┼───────────┤
│CONDITIONER│RECONDITION│
├───────────┼───────────┤
│CONSIDERATE│DESECRATION│
├───────────┼───────────┤
│COORDINATES│DECORATIONS│
├───────────┼───────────┤
│DEIFICATION│EDIFICATION│
├───────────┼───────────┤
│DENOMINATES│EMENDATIONS│
├───────────┼───────────┤
│DENOTATIONS│DETONATIONS│
├───────────┼───────────┤
│DERAILMENTS│STREAMLINED│
├───────────┼───────────┤
│DESCRIPTION│PREDICTIONS│
├───────────┼───────────┤
│DISCOVERERS│REDISCOVERS│
├───────────┼───────────┤
│ENTERPRISES│INTERSPERSE│
├───────────┼───────────┤
│ENUMERATION│MOUNTAINEER│
├───────────┼───────────┤
│IMPERATIVES│SEMIPRIVATE│
├───────────┼───────────┤
│IMPORTUNATE│PERMUTATION│
├───────────┼───────────┤
│IMPRESSIONS│PERMISSIONS│
├───────────┼───────────┤
│INCORPORATE│PROCREATION│
├───────────┼───────────┤
│INDEFINITES│INTENSIFIED│
├───────────┼───────────┤
│INTEGRATION│ORIENTATING│
├───────────┼───────────┤
│INTERVENING│REINVENTING│
├───────────┼───────────┤
│PARLIAMENTS│PATERNALISM│
├───────────┼───────────┤
│PARTITIONED│TREPIDATION│
├───────────┼───────────┤
│PERIPATETIC│PRECIPITATE│
├───────────┼───────────┤
│PETITIONERS│REPETITIONS│
├───────────┼───────────┤
│PREDECESSOR│REPROCESSED│
├───────────┼───────────┤
│RATIONALIZE│REALIZATION│
├───────────┼───────────┤
│RECEIVABLES│SERVICEABLE│
├───────────┼───────────┤
│REINSTATING│STRAITENING│
├───────────┼───────────┤
│REPERTOIRES│REPERTORIES│
├───────────┼───────────┤
│REUPHOLSTER│UPHOLSTERER│
└───────────┴───────────┘

APL (91)
{⎕ML←3⋄{⎕←⍵/S}¨↓⍉K∘.≡Z/⍨T=⌈/T←+⌿K∘.≡Z←∪K←{⍵[⍋⍵]}¨S←W/⍨⍵=↑∘⍴¨W←W⊂⍨~⎕TC∊⍨W←80 ¯1⎕MAP'w'}¨2+⍳9

Expects the word list to be in a file called w in the current directory. Takes about four minutes to run (but it was running in a virtual machine).
The default workspace size in Dyalog APL is 64kb, this is not enough so you need to increase it (I set it to a megabyte).
Explanation:

⎕ML←3: to make ⊂ work as partition
{...}¨2+⍳9: for [3..11]
W←W⊂⍨~⎕TC∊⍨W←80 ¯1⎕MAP'w': read the w file and split on terminal control characters (newlines and tab)
S←W/⍨⍵=↑∘⍴¨W: filter out the words of the current length
K←{⍵[⍋⍵]}¨S: sort the letters of each word
T←+⌿K∘.≡Z←∪K: for each unique bag of letters, see how many times it appears
Z/⍨T=⌈/T: select those groups of letters that occur as many times as the most occuring one
↓⍉K∘.≡Z/⍨T: for each group of letters and each word, select those words that have the same letters
{⎕←⍵/S}: for each set of words, select those words from the non-sorted list and display them.


text:
Smallest C code to Crash an Operating System?
A shortest C program, that can crash the Operating system, either on a Windows or a Linux PC...
Rules:

The code is to be developed in C language, but it may use other api, specific to linux or windows systems.
The Operating System  is said to have been put out of commission,  if either it has come to a state[Standstill or otherwise] , where no matter how much time passes, the system is rendered inoperable or (even better), self restarts itself, or something similar to a blue screen of death.
To be most effective, the program will be run as a normal user and not as superuser or an administrator.
For every valid program that is able to crash the PC, countermeasures can be suggested by others in the comments, successful measures that can nullify the effect of the program gets the answer invalidated. For Example - If an answer suggests use of fork Bombs, i would suggest measures like this in the comments.
Since Linux OS is considered more stable, a program that crashes linux is always a better one, even if it takes extra code than it takes to crash windows, but still the smallest program to crash the OS wins, independent of the platform.
The community is free to edit the question to add more sensible rules, provided the new rules maintain compatibility with existing answers.

Note: This above question is asked with the purpose of demonstrating the raw power of C[or the lack of it] as a low level/mid level language. Also hopefully, to become more aware of OS security, and possible measures that can be taken.
EDIT:
A similar question lies here Code Golf of Death...
But here are the reasons my question differs from the above mentioned one...

I am looking for the answers to only be in C language.
Though the above question has one answer in C, the code works only for a rare version of pentium 5. So in short there is no C language based answer in the above question to achieve the end purpose.
In the other question Kernel-mode drivers are allowed, but my question concentrates mainly on user space processes.
Some of the answers in the above question allow the programs to run in supervisor/administrator mode, but such privileged execution of the program is not allowed in the rules stated by my question.
In the similar question the answer with highest upvotes win, in my question answer which crashes the OS , using the shortest code, and does so without any suggestion of countermeasure to be taken against the method employed by the answer.
In short, apart from the same intention of crashing the OS , the two questions differ in every other aspect.

@PeterTaylor Tried searching for a similar question before posting this one , but could not find any(why would i think of searching "Code Golf of Death" :) ). Thanks for giving a link to a similiar question. But the question is not an exact duplicate , since i want my code to be short , and to be in C, not bash or any other language. Also i've added  the option where countermeasures are given in comments.Though the intention of the questions are same , the approach and purpose of doing so is different.

I found it by searching for "crash", but I did have the advantage of a vague memory that there had been a similar question before. I agree that it's not an exact duplicate, but it's close enough that any answer to this question would be a valid answer to the other one, and the existing C answers to the other question would be valid answers to this one. I regard the wording "exact" in the close reason as unhelpful; if the essence of the question is the same, there's no benefit to splitting or duplicating the answers. Feel free to start a topic in meta about what "duplicate" means.

@PeterTaylor, if you say its a duplicate, then it sure is, since you have been using this site for 2 years....But still am not satisfied enough with the C solutions in the other question ,simply because there is none, and the only solution (which is a really good one) , relies on a very rare version of pentium 5(and outdated too)....But still please free to close the question if you still feel it is appropriate to do so....

I am fine with the question being closed as duplicate, but why the downvotes...I have adhered to the faq guidelines as far as possible, is there something i missed ??

Shame it's closed.  You said the community can edit the rules as long as they accept existing answers.  I was gonna add a rule "boothby's solutions are allowed to presume the use of a sledgehammer" and win with a zero character program!

29 chars
Linux
int main(){system("init 6");}

I know, very lame. But hey, it reboots the system. Wasn't that the task?
Windows 38 chars
int main(){system("shutdown.exe /r");}

Works as normal user.

+1 for exploiting the vulnerability in the rules of the question itself, but clearly in the context of the question, self restarts itself means typically the system self restarting after a crash....so this answer is a no go...

Depends if you see init as part of the system or not (I just tell init to reboot).

True...Init is part of the system ,...But the reboot is a graceful one, not a crash...

Why not halt?  You shave 2 chars and it doesn't even come back...

according to the task, restart is better.


text:
exp function to an arbitrary double precision
Write a function to find the solution of e^x given x, and a precision in the form 0.000001.
sample input and output:
e(4,0.00001) will return 54.5981494762146, and the precision is +/- .00001. The output would be acceptable in the range 54.59814 <= output <= 54.59816, you are not required to truncate the answer to the number of significant figures in the input precision.
Your example will be expected to take a precision of at least size double (64 bits) and an x of at least size int (32 bits). Overflows will not be counted against you; I do not expect passing INT_MAX as x to work.
Use whatever algorithm suits you, but do not use math library functions such as builtin pow, factorial, exp, or builtin predefined constants for e, pi, etc.
The objective primary winning criterion is size of submission in bytes, ignoring comments and unnecessary whitespace.
Ties will be broken via runtime speed.
This will last at least one week (ending Thursday, May 16) with each new entry extending the deadline to three days from the entry date.

Is there a limit to the precision?

What is the objective primary winning criterion?

Is this for all possible values of x or are there limits?

Surely with your example input, 54.59814999 would be a valid output?

exp(4,.00001) is nowhere near 54.

I have updated the question to address all of these concerns.

@KeithRandall yes it is

What are math libraries? Some languages have exp built in.

@JohannesKuhn that's what I was specifying should be disallowed. You need to write your own exp, pow, and factorial if you're going to use them in your algorithm.

What about the use of predefined constants (like e in this case). Some languages (esp. Math languages) have this number build-in.

Yet another good point. The spirit of this challenge is to come up with a novel way of calculating e, not simply counting digits and spitting it out.

@Greg: I was confused by your notation: by exp(4,.00001) you mean e^4 with a tolerance of .00001, not 4^.00001.

@KeithRandall Yep, sorry for the confusion.

Does negative numbers have to work?

@JohannesKuhn For this case lets ignore negative input since so many answers would fail given negative numbers.

APL (36)
{x t←⍺⍵⋄0{t>i←(x*⍵)÷!⍵:⍺⋄∇/⍺⍵+i 1}0}

The left argument is the number and the right argument is the tolerance, i.e.
      4 {x t←⍺⍵⋄0{t>i←(x*⍵)÷!⍵:⍺⋄∇/⍺⍵+i 1}0}  0.00001
54.59814722

It uses a power series expansion.
Explanation:

x t←⍺⍵: store the left argument (x) in x and the right argument (tolerance) in t
0{...}0: iterator function, ⍺ is the accumulator and ⍵ is the iteration
t>i←(x*⍵)÷!⍵: calculate the current iteration's value, and see if it is higher than the tolerance
:⍺: if so, return the accumulator
⋄∇/⍺⍵+i 1: if not, increment the accumulator by i and the iteration by 1 and try again.

Mathematica, 90
f[x_,p_]:=Piecewise[{{Sum[x^i/i!,{i,0,50}],x>0},{1/Sum[(-x)^i/i!,{i,0,50}],x<0},{1,x==0}}]

I also ignore the precision p and assume that 20 decimal points will be the most accuracy desired. It also works for negative values of x! To be worked on more later.
Python, 88
def E(x,p):
 t=n=s=1.;y=x
 if x<0:y=-x
 while t:t*=y/n;n+=1;s+=t
 if x<0:s=1/s
 return s

Why the Power Series approach does not work without cases:
The issue with the taylor series for e(x) centered at the origin is that it is alternating for negative x. When the distance from the origin is small, say x= -1 or -2 then this is not an issue as we get convergence to 20 decimal places after about 20-30 terms of the power series. However when the distance from the origin grows all hell breaks loose. Observe the pattern for x= -1 where f[x,n] refers to the taylor series with n+1 terms.
Exp[-20] = 2.0611536224385578280*10^-9
f[-20,1] = -19.000000000000000000
f[-20,2] = 181.00000000000000000
f[-20,3] = -1152.3333333333333333
f[-20,4] = 5514.3333333333333333
...
f[-20,10] = 1.8596236807760141093*10^6
f[-20,15] = -1.4140053694562736891*10^7
f[-20,20] = 2.1277210342544299144*10^7
f[-20,30] = 1.5996940964229284082*10^6
f[-20,40] = 4442.0343631250907290
f[-20,50] = 1.0469169720658217252
f[-20,60] = 0.000034317328370370852087
f[-20,70] = 2.2782871646157681977*10^-9

It takes until term 70 to get within .000000001 of the true value, and I was being kind using x= -20. If we try numbers as low as x= -500 we are more than 10^200 off at term 500. Now lets see, what are we even working with at this point, iteration 500, this should include the term x^500/500!. 500! if of the order 10^1134, but python and other programming languages are not equipped to deal with numbers much larger than 2^63 as integers or 10^308 for doubles (unless you have some sort of arbitrary precision library...?)

Great explanation on negative x.

Python, 59 57 chars
def E(x,p):
 t=n=s=1.
 while t:t*=x/n;n+=1;s+=t
 return s

Uses the power series expansion of e^x.  Ignores p and just calculates the result to full double precision.

You may save to chars with the initialisation if you reorder while t:t*=x/n;n+=1;s+=t.

C, 88 69

double e(int e, double l) {double a,p=1,i=0,f=1,r=1;while ((a=(p*=e)/(f*=++i))>l) r+=a;return r;}

double e(int x, double l) {double i=0,t=1,r=1;while (t*=x/++i) r+=t;return r;}

call e. if you change the first argument to e from int to double, it will even work for floating point exponents.
Code counted without any white space or comments.
Edited some ideas from Keith into it (combine p and f into t, ignore l).
Yes, power series is the way to go. Sure, once one got the idea, everyone copy it.

Example: Idone. I don't know why there is a runtime error, maybe someone can enlighten me.

Missing return 0. http://ideone.com/dvHlO1

JavaScript, 50 Chars
Given that javascript has variable args support, this will work with the input e(4,0.00001). Otherwise, it would be 52 chars.
function e(x){for(t=n=s=1;t*=x/n++;s+=t);return s}

ideone
If it is going to factor in the precision as the problem states, it can be done in 56 chars.
function e(x,p){for(t=n=s=1;(t*=x/n++)>p;s+=t);return s}


text:
Avoid duplicate entries using a sign change
This anecdote contains the following intriguing exchange:

"Fine, Fred," Avi interrupted. "Then how would you change this to
  avoid duplicate entries?"
"Oh, just change that one there to a negative one."

While this claim is not accurate in context, I do wonder if there's some plausible code for which that makes sense.
Your challenge is to write code (a program, a function, whatever) that fits this criteria:

Merges two input lists into one, keeping duplicates. [edit: You can optionally assume that they are integers, and/or that the lists themselves are unique. You can't assume the integers are positive (the one answer that does this is grandfathered in).]
A literal "1" appears somewhere in the code. If you change this to a literal "-1", the code does the same thing but removing duplicates.
The code does not simply branch off of the 1/-1. We're not looking for if (1 < 1) removeDuplicates() or [do_nothing, merge_with_dups, merge_without_dups][1].call(), for example.

Input and output can be in any reasonable format you choose. One example might be
[1,2],[2,3]->[1,2,2,3] before the sign change, and [1,2,3] after.
This is a popularity contest. It is not code golf, unless you want to show off. I'll accept the highest-voted answer in about two weeks.

What is the input - only integers? Positive and/or negative? If the input lists contain duplicates, should they be removed in the -1 case?

Should we assume the input lists are sorted and don't contain duplicates themselves?

My first thought when I saw that on the DailyWTF was that they needed to define "merge". This question also needs a definition thereof.

"They call him Boris the Bullet Dodger" "Why do they call him that?" "... Because he dodges bullets, Avi". Any Snatch fans on CodeGolf?

JavaScript
Take a conventional algorithm and write it with a bug:
function merge(a, b) {
  var ai = 0, bi = 0, oi = 0;
  var o = [];
  while (ai < a.length && bi < b.length) {
    var v = a[ai] < b[bi] ? a[ai++] : b[bi++];
    if (v !== o[oi + 1]) {
      o[oi++] = v;
    }
  }
  while (ai < a.length) o[oi++] = a[ai++];
  while (bi < b.length) o[oi++] = b[bi++];
  return o;
}

This code contains exactly one literal 1. If it is changed to -1, then duplicates will be removed. It can be used on any comparable values.

APL 22/23
Prompts for screen input via ←⎕ and returns an ordered merged list with or, if the leading one is set negative, without duplicates.
(~1=0,-2=/v)/v←v[⍋v←⎕]

⎕:
    (1 2),(2 3)
1 2 2 3

(~¯1=0,-2=/v)/v←v[⍋v←⎕]

⎕:
    (1 2),(2 3)
1 2 3

Byte counters please note that the single byte APL characters have been converted to UTF8 to render properly on this site.

How does the -1 change everything?

@Johannes Kuhn For the above example the code 0,-2=/v yields the vector 0 0 ¯1 0 with ¯1 indicating the position of a duplicate entry. Testing this vector against 1 and ¯1 yields 0 0 0 0 or 0 0 1 0 reversing the boolean elements gives 1 1 1 1 or 1 1 0 1. These vectors are used to select the appropriate elements from the merged vector.

k (18)
Should work for any valid type of list
{(*1#(::;?:))@x,y}

Example:
k){(*-1#(::;?:))@x,y}[1 2 3 4;3 4 5 6]
1 2 3 4 5 6
k){(*1#(::;?:))@x,y}[1 2 3 4;3 4 5 6]
1 2 3 4 3 4 5 6

Python
def merge(a, b):
    return a + [i for i in b if i not in a*- 1]

Bash
In the spirit of the context, this program removes the duplicates if you add a minus sign before the lowercase l on the grep line. If you add a minus sign before the uppercase I on the previous line, or before the digit 1 on the next line, the program doesn't behave differently.
The input files contain one integer per line (this is the usual representation of lists as text files). They must be passed as two arguments. The resulting list is written to standard ouptut.
# Create temp file for working
temp=$(mktemp -d)
# Copy left and right file to merge into same
cp $1 $temp/l
cp $2 $temp/r
cd $temp

while read num
do
  # I remove the output
  set `grep -Lax -e $num l ` <r> /dev/null
  if [ $# != 1 ]
  then echo $num >>r
  fi
done <l

cp r /dev/stdout
cd
rm -r $temp

Feel free to use this program as an example of your best code in an interview. All I ask is that you don't say that it's my best code.

Tcl
In the spirit of the quote
foreach item $list1 {
    if {$item in $list2} {set item [expr {$item * 1}]}
    lappend list2 $item
}
foreach item $list2 {
    if {$item >= 0} {lappend result $item}
}

If it is a duplicate, multiply it with (-)1, after that filter out negative values.

This answer was written that way before the question changed. In spirit of the quote, I still prefer making the entries negative.

I'm beginner in PHP I don't know if it's correct
$list1=explode(',',$_GET['list1']);
$list2=explode(',',$_GET['list2']);
$list_merged=array_merge($list1,$list2);
print_r($list_merged);
$list_unique=array_unique($list_merged);
print_r($list_unique);

It doesn't look like this actually answers the challenge - I don't see a literal 1 anywhere in your code.