Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Just for fun: Shortest InputForm to achieve a given Kernel error

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82031] Just for fun: Shortest InputForm to achieve a given Kernel error
  • From: "Andrew Moylan" <andrew.j.moylan at gmail.com>
  • Date: Wed, 10 Oct 2007 04:21:55 -0400 (EDT)

"1/0" is a string of length 3 which, when interpreted as InputForm (in a
clean Kernel), generates a Power::infy error:

ToExpression["1/0", InputForm];
>> Power::infy: Infinite expression 1/0 encountered.

I think this is the shortest string with this property.

Here are some other errors and the lengths of the shortest strings I can
find to generate them:

$RecursionLimit::reclim: Recursion depth of 256 exceeded.
Input length: 4

General::ovfl: Overflow occurred in computation.
Input length: 5

(Kernel running out of memory)
Input length: 5

General::unfl: Underflow occurred in computation.
Input length: 6

$IterationLimit::itlim: Iteration limit of 4096 exceeded.
Input length: 7

Can you figure out how to generate those errors with input strings of that
length? Can you find any *shorter* solutions?



  • Prev by Date: Matrices
  • Next by Date: Strange Manipulate+ContourPlot behavior
  • Previous by thread: Re: Matrices
  • Next by thread: Re: Just for fun: Shortest InputForm to achieve a given Kernel error