comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Re: Generation of permutations
Date: Thu, 09 May 2002 17:44:03 GMT
Date: 2002-05-09T17:44:03+00:00	[thread overview]
Message-ID: <3CDAB578.6F32339D@san.rr.com> (raw)
In-Reply-To: uznzd8jul.fsf@gsfc.nasa.gov

Stephen Leake wrote:
> 
> "Chad R. Meiners" <crmeiners@hotmail.com> writes:
> 
> > No that is not what Robert was saying.  He was referring to Rice's Theorem
> > for which you can clearly show that the problem of determining whether a
> > given set of machine instructions will sort an given input is
> > Turing-undecidable.  How did you come to such a misinterpretation?
> 
> Doesn't sound like a "misinterpretation" to me.
> 
> Let's try some symbolic logic:
> 
> A : "a given set of machine instructions"
> B : "a given input"
> C : A sorts B
> 
> Rice's Theorem says statement C is "Turing-undecideable".
> 
> Question; does that mean C is "false"?

No, it means that you can't write a program that runs on a turing
machine that will invariably decide in finite time whether C is true or
not. C isn't false, it's undecidable. It's right there in the word. :-)

Note that "undecidable" isn't talking about A or B or C as such. It's
more talking about a program that *looks* at As and Bs and decides
whether C is true.

> A' : "set of instructions emitted by GNAT for bubble sort"
> B' : "a given input"
> C' : A' sorts B'
> 
> So Rice's Theorem says statement C' is "Turing-undecideable".

Yes. You have to understand that if you limit "A" to be "a set of
instructions emitted by GNAT for bubble sort" then the question goes
away. You can just write a program that outputs "true" without even
looking at the inputs, and you'll be giving the right answer. But that
same program won't work if you give it a different A'', which is a set
of instructions emitted by GNAT for generating a random permutation of
B''.

It's the difference between asking "does this program sort the list" and
"does this sort program sort the list".  Of course the sort program
sorts the list, because you told me it's a sort program.

It's kind of like the difference between Big-O and Big-Theta in
performance. Does a bubble sort run in O(N**2)? Yep. Can you sort
faster?  You can't tell just by looking at bubble sorts. No matter how
many algorithms you look at, you'll never figure out if you've found the
fastest one. You have to look at the *problem* to decide if you've found
the fastest algorithm.

> Is C' "true"?

Yes, but irrelevant.
 
> If C' is "true", does that mean A' "constitutes a general sorting
> algorithm". I think so, if we assume B' is allowed to vary over all
> possible inputs.

Right. So? The question is not whether it's possible to look at one
program and decide what it does. The question is whether it's possible
to write a program to look at all programs and decide whether or not
they sort.
 
> I suspect the problem here lies in the conflict between the English
> meanings of "true" and "decideable", and the formal meaning of
> "Turing-(un)decideable". We all believe that C' is "true", but that's
> not the same as "Turing-decideable".

"Turing undecidable" means basically that there's no program you can
write for a turing machine that given as input A will tell you whether C
is true for all B's, if said turing machine program has to always be
right and has to always finish in a finite amount of time. Of course for
any *one* A you can decide this, but that's irrelevant because that
program will not work on some sort that isn't A.
 


Put it this way. Does the following program calculate square roots?
   Put_Line("5");

Well, if the input is 25, then yes, it calculates square roots.

That's a simplification of the logic you're sort of applying there -
sure, that a sort program sorts a list can be proven, but that's not
what "sorting is undecidable" means. If sorting were decidable, it would
be possible to look at any program and figure out reliably whether it
sorts or not.

Try this one:
A": A buggy bubblesort that sorts B as long as the biggest value doesn't
start at the beginning of the list.
B": A list of numbers with the biggest value already in the middle
C": Does A" sort B"?

Well, yes, but again, irrelevant for exactly the same reason. No, A"
isn't a general sort because it doesn't work when B" is different. For
the same reason, sorting isn't decidable because your program to decide
whether its a general sort gives the wrong answer when A' is a different
program.

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
   The 90/10 rule of toothpaste: the last 10% of 
         the tube lasts as long as the first 90%.



  reply	other threads:[~2002-05-09 17:44 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-29 11:54 Generation of permutations Reinert Korsnes
2002-04-30 13:52 ` Ted Dennison
2002-04-30 14:20   ` Marin David Condic
2002-05-02 12:32     ` Robert Dewar
2002-05-02 15:47     ` Ted Dennison
2002-05-02 16:16       ` Mark Biggar
2002-05-03 13:04         ` Marin David Condic
2002-05-05  0:52           ` Robert Dewar
2002-05-05 23:11             ` tmoran
2002-05-06  2:13               ` Chad R. Meiners
2002-05-06 13:52                 ` Stephen Leake
2002-05-09 17:44                   ` Darren New [this message]
2002-05-09 18:07                     ` Stephen Leake
2002-05-09 20:58                       ` Darren New
2002-05-09 23:21                         ` tmoran
2002-05-09 23:51                           ` Darren New
2002-05-10  3:37                             ` tmoran
2002-05-10  3:59                               ` Darren New
2002-05-10 13:13                               ` Robert Dewar
2002-05-25 16:21                         ` Robert I. Eachus
2002-05-09 23:24                       ` Robert Dewar
2002-05-09 23:48                       ` Robert Dewar
2002-05-10  3:37                         ` tmoran
2002-05-10 15:10                         ` Chad R. Meiners
2002-05-11  4:04                           ` Robert Dewar
2002-05-16  1:35                             ` Chad R. Meiners
2002-05-11  4:05                           ` Robert Dewar
2002-05-06 15:46                 ` Wes Groleau
2002-05-06 16:21                   ` Chad R. Meiners
2002-05-06 16:33                   ` Darren New
2002-05-07  0:06                     ` tmoran
2002-05-07  0:26                       ` Darren New
2002-05-07  1:56                         ` tmoran
2002-05-07 10:39                           ` Robert Dewar
2002-05-07 17:25                             ` Chad R. Meiners
2002-05-08  2:27                               ` Robert Dewar
2002-05-08  8:44                               ` Mats Karlssohn
2002-05-07 17:00                         ` Wes Groleau
2002-05-06 21:33               ` Robert Dewar
2002-05-06 17:26             ` Marin David Condic
2002-05-07  7:35             ` tmoran
2002-05-07 13:22               ` Marin David Condic
2002-05-08  5:23                 ` tmoran
2002-05-08 14:10                   ` Marin David Condic
2002-05-09 16:20                     ` Darren New
2002-05-09 19:04                     ` tmoran
2002-05-08 16:20                   ` Darren New
2002-05-08 17:31                     ` tmoran
2002-05-08 17:39                     ` Chad R. Meiners
2002-05-07 15:34               ` Darren New
2002-05-07 17:44               ` Chad R. Meiners
2002-05-07 19:58                 ` tmoran
2002-05-07 21:05                   ` Turing-undecidable languages (OT) Chad R. Meiners
2002-05-08  8:24                     ` Danx
2002-05-08 17:16                       ` Chad R. Meiners
2002-05-10  2:37                       ` Robert Dewar
2002-05-08  9:16                     ` Dmitry A. Kazakov
2002-05-08 17:18                       ` Chad R. Meiners
2002-05-09 20:56                         ` Dmitry A.Kazakov
2002-05-09 16:18                           ` Chad R. Meiners
2002-05-10  2:52                             ` Robert Dewar
2002-05-08  2:17               ` Generation of permutations Robert Dewar
2002-05-03 13:13         ` Ted Dennison
2002-05-03 13:24           ` Lutz Donnerhacke
2002-04-30 15:06   ` Hyman Rosen
2002-05-01  8:40     ` Adrian Hoe
2002-05-01 19:53       ` Hyman Rosen
2002-05-11  1:52     ` Steven Deller
2002-05-02 16:24   ` Mark Biggar
2002-04-30 17:12 ` Wes Groleau
2002-04-30 22:57   ` Robert Dewar
2002-05-01  0:54     ` tmoran
2002-05-01  9:42       ` Florian Weimer
2002-05-02 12:34         ` Robert Dewar
2002-05-01 12:43       ` Robert Dewar
2002-05-01 15:05         ` TO WHOM IT MAY CONCERN Wes Groleau
2002-05-02 12:27           ` More on copyright, (Re: TO WHOM IT MAY CONCERN) Robert Dewar
2002-05-08 13:56             ` Wes Groleau
2002-05-08 18:01               ` Robert Dewar
2002-05-08 18:31                 ` Hyman Rosen
2002-05-09 13:41                 ` Wes Groleau
2002-05-01 12:46       ` Generation of permutations Robert Dewar
2002-05-01 18:22         ` OT:Copyright, was " tmoran
2002-05-01 21:56           ` Robert Dewar
2002-05-01 23:45             ` tmoran
2002-05-02 11:58               ` Robert Dewar
2002-05-01 14:55     ` Wes Groleau
2002-05-02 12:41       ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox