Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #8286

Re: what is a loop invariant

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From Todd Carnes <toddcarnes@gmail.com>
Newsgroups comp.lang.c++
Subject Re: what is a loop invariant
Date Wed, 27 Jul 2011 12:29:56 +0000 (UTC)
Organization Aioe.org NNTP Server
Lines 23
Message-ID <pan.2011.07.27.12.29.57@gmail.com> (permalink)
References <7082e075-e6b2-4ae0-9a89-f31ae1684769@f39g2000prb.googlegroups.com> <j0mhea$3ld$1@dont-email.me>
NNTP-Posting-Host uqlV+6kNo2Z0TnMsKGN6tA.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Complaints-To abuse@aioe.org
User-Agent Pan/0.133 (House of Butterflies)
X-Notice Filtered by postfilter v. 0.8.2
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:8286

Show key headers only | View raw


On Tue, 26 Jul 2011 10:02:50 -0400, Victor Bazarov wrote:

> On 7/26/2011 9:26 AM, johan1990 wrote:
>> i am reading introduction to algorithms and i have no idea of what the
>> concept "loop invariant" means. i really appreciate it if there is a
>> easy way to explain it.  :~)
> 
> Uh...  http://en.wikipedia.org/wiki/Loop_invariant isn't easy?  Try it.
>   Also, consider 'comp.programming' for general questions like that.
> 
> V

Actually, the Wikipedia article is NOT written very well. For example, 
the very first sentence reads... "In computer science, a loop invariant 
is an invariant used to prove properties of loops." When one is defining 
something for someone, one should NEVER use the same word they are 
explaining in the explanation. (in this case "invariant").

Also, the rest of the explanation expects the reader to be fairly well 
versed in computer science & logic, which one cannot assume from the OP's 
question.

Todd

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

what is a loop invariant johan1990 <81378989@qq.com> - 2011-07-26 06:26 -0700
  Re: what is a loop invariant Victor Bazarov <v.bazarov@comcast.invalid> - 2011-07-26 10:02 -0400
    Re: what is a loop invariant Todd Carnes <toddcarnes@gmail.com> - 2011-07-27 12:29 +0000
      Re: what is a loop invariant Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-07-27 21:22 +0000
        Re: what is a loop invariant "Alf P. Steinbach" <alf.p.steinbach:usenet@gmail.com> - 2011-07-28 01:42 +0200
          Re: what is a loop invariant Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-07-28 08:52 +0000
          Re: what is a loop invariant James Kanze <james.kanze@gmail.com> - 2011-07-30 12:12 -0700
            Re: what is a loop invariant "Alf P. Steinbach" <alf.p.steinbach:usenet@gmail.com> - 2011-07-31 02:52 +0200
        Re: what is a loop invariant Robert Wessel <robertwessel2@yahoo.com> - 2011-07-27 22:10 -0500
          Re: what is a loop invariant James Kanze <james.kanze@gmail.com> - 2011-07-30 12:03 -0700
  Re: what is a loop invariant Saeed Amrollahi <amrollahi.saeed@gmail.com> - 2011-07-26 09:04 -0700
  Re: what is a loop invariant "Paul" <pchristor@yahoo.co.uk> - 2011-07-26 22:55 +0100
    Re: what is a loop invariant Juha Nieminen <nospam@thanks.invalid> - 2011-07-27 07:50 +0000
      Re: what is a loop invariant "Paul" <pchristor@yahoo.co.uk> - 2011-07-27 11:11 +0100
        Re: what is a loop invariant Juha Nieminen <nospam@thanks.invalid> - 2011-07-27 13:44 +0000
          Re: what is a loop invariant "Paul" <pchristor@yahoo.co.uk> - 2011-07-27 15:38 +0100
            Re: what is a loop invariant Oliver Jackson <chexmofo@hotmail.com> - 2011-07-27 23:25 -0700
              Re: what is a loop invariant "Paul" <pchristor@yahoo.co.uk> - 2011-07-28 19:45 +0100
    Re: what is a loop invariant Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-07-27 00:46 -0700
  Re: what is a loop invariant Geoff <geoff@invalid.invalid> - 2011-07-27 21:41 -0700

csiph-web