2

I had come up with a Ruby quine:

eval s=%q(puts"eval s=%q(#{s})")

and claimed it to be the shortest, but a quine originally written for Perl by "Robin Houston" and ported to Ruby by "Sabby and Tabby":

puts <<2*2,2
puts <<2*2,2
2

turned out to be shorter. I wonder if one could prove that a shorter non-zero quine is in fact impossible in Ruby. How would you do that? A zero-length script is a quine per definition in Ruby but that is a trivial corner case that is often discarded. Scripts that read their own input like print IO.read($0) are not quines, so they don't count.

Just because no shorter one has been posted doesn't make it the shortest. So how can it be proved (like scientifically) that a specific quine is the shortest?

henon
  • 2,022
  • 21
  • 23
  • 1
    Seems like the kind of question that is best asked on http://cs.stackexchange.com/ – Mark Thomas Jul 14 '14 at 20:27
  • @sawa: this is not a duplicate. I didn't ask for the shortest quine but for a way to prove that there is no shorter one. – henon Jul 16 '14 at 11:48
  • @henon I had useful comments for you, but since you had abandoned the question (hadn't appeared after the post), I deleted them, and closed the question. Anyway, it should be closed as MarkThomas says. – sawa Jul 16 '14 at 12:28
  • @henon By the way, you seem to be misunderstanding either the word "prove" or "scientific". Nothing can be proved (in your sense) scientifically. Scientific method is an attempt to get close to the reality that cannot be proved (which must be an infinite set of incidents), based on finite set of observation. A scientific hypothesis may be falsified, but can never be proven. – sawa Jul 16 '14 at 12:29

0 Answers0