Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > That interesting notation used to describe how long a loop willtake.

Reply
Thread Tools

That interesting notation used to describe how long a loop willtake.

 
 
Tobiah
Guest
Posts: n/a
 
      10-04-2010
It gets used here frequently, but not
having majored in programming, I'm not
familiar with it. One might say:

Don't do it that way, it will result in O(n**2)!

Or something like that. I read this to mean
that the execution time varies with the square
of the number of iterations, or items being sorted
etc..

I want to google this, but I'm not sure what
keywords to use. Is there a wikipedia article about this
subject? I imagine that it has a concise name.

Thanks,

Tobiah
 
Reply With Quote
 
 
 
 
Ian
Guest
Posts: n/a
 
      10-04-2010
On Oct 4, 12:38*pm, Tobiah <t...@rcsreg.com> wrote:
> It gets used here frequently, but not
> having majored in programming, I'm not
> familiar with it. *One might say:
>
> Don't do it that way, it will result in O(n**2)!
>
> Or something like that. *I read this to mean
> that the execution time varies with the square
> of the number of iterations, or items being sorted
> etc..
>
> I want to google this, but I'm not sure what
> keywords to use. *Is there a wikipedia article about this
> subject? *I imagine that it has a concise name.


"Big O notation"

Cheers,
Ian
 
Reply With Quote
 
 
 
 
Matteo Landi
Guest
Posts: n/a
 
      10-04-2010
Here you are:

http://en.wikipedia.org/wiki/Big_O_notation

Best regards,
Matteo


On Mon, Oct 4, 2010 at 8:38 PM, Tobiah <> wrote:
> It gets used here frequently, but not
> having majored in programming, I'm not
> familiar with it. *One might say:
>
> Don't do it that way, it will result in O(n**2)!
>
> Or something like that. *I read this to mean
> that the execution time varies with the square
> of the number of iterations, or items being sorted
> etc..
>
> I want to google this, but I'm not sure what
> keywords to use. *Is there a wikipedia article about this
> subject? *I imagine that it has a concise name.
>
> Thanks,
>
> Tobiah
> --
> http://mail.python.org/mailman/listinfo/python-list
>




--
Matteo Landi
http://www.matteolandi.net/
 
Reply With Quote
 
MRAB
Guest
Posts: n/a
 
      10-04-2010
On 04/10/2010 19:38, Tobiah wrote:
> It gets used here frequently, but not
> having majored in programming, I'm not
> familiar with it. One might say:
>
> Don't do it that way, it will result in O(n**2)!
>
> Or something like that. I read this to mean
> that the execution time varies with the square
> of the number of iterations, or items being sorted
> etc..
>
> I want to google this, but I'm not sure what
> keywords to use. Is there a wikipedia article about this
> subject? I imagine that it has a concise name.
>

It's called the "Big O notation".
 
Reply With Quote
 
Neil Cerutti
Guest
Posts: n/a
 
      10-04-2010
On 2010-10-04, MRAB <> wrote:
> On 04/10/2010 19:38, Tobiah wrote:
>> It gets used here frequently, but not
>> having majored in programming, I'm not
>> familiar with it. One might say:
>>
>> Don't do it that way, it will result in O(n**2)!
>>
>> Or something like that. I read this to mean
>> that the execution time varies with the square
>> of the number of iterations, or items being sorted
>> etc..
>>
>> I want to google this, but I'm not sure what
>> keywords to use. Is there a wikipedia article about this
>> subject? I imagine that it has a concise name.
>>

> It's called the "Big O notation".


The web version of the book "Data Structures and Algorithms with
Object-Oriented Design Patterns in Python" contains a an
explanation in the chapters Algorithm Analysis and Asymptotic
Notation.

http://www.brpreiss.com/books/opus7/

--
Neil Cerutti
 
Reply With Quote
 
Chris Rebert
Guest
Posts: n/a
 
      10-04-2010
> On Tue, Oct 5, 2010 at 12:08 AM, Tobiah <> wrote:
>> It gets used here frequently, but not
>> having majored in programming, I'm not
>> familiar with it. Â*One might say:
>>
>> Don't do it that way, it will result in O(n**2)!
>>
>> Or something like that. Â*I read this to mean
>> that the execution time varies with the square
>> of the number of iterations, or items being sorted
>> etc..
>>
>> I want to google this, but I'm not sure what
>> keywords to use. Â*Is there a wikipedia article about this
>> subject? Â*I imagine that it has a concise name.


On Mon, Oct 4, 2010 at 11:58 AM, Shashank Singh
<> wrote:
> this might help:
>
> http://en.wikipedia.org/wiki/Analysis_of_algorithms


Additionally:
http://en.wikipedia.org/wiki/Time_complexity

Cheers,
Chris
 
Reply With Quote
 
Roy Smith
Guest
Posts: n/a
 
      10-05-2010
In article <Kapqo.16572$>,
Tobiah <> wrote:

> Don't do it that way, it will result in O(n**2)!
> [...]
> I want to google this, but I'm not sure what
> keywords to use. Is there a wikipedia article about this
> subject? I imagine that it has a concise name.


Google for "Big-O notation". Depending on your level of interest,
expect to spend anywhere from an hour to the next four years reading
what pops out
 
Reply With Quote
 
Edward A. Falk
Guest
Posts: n/a
 
      10-05-2010
In article <roy->,
Roy Smith <> wrote:
>In article <Kapqo.16572$>,
> Tobiah <> wrote:
>
>Google for "Big-O notation". Depending on your level of interest,
>expect to spend anywhere from an hour to the next four years reading
>what pops out


Yeah, that's my problem with Wikipedia too. Plus, they like to just
roll up their sleeves and dive right into the math. It's like a bucket
of ice water to the face if you're a mathematical layman.

Tobiah, for the purposes of 99% of the work you'll be doing in computing,
you don't need all that math. Just think of O(foo) as meaning "On the
order of foo". This means basically that you evaluate foo, and the time
your algorithm takes to execute is proportional to that.

So for example, O(n^2) means that the time the algorithm takes to run
is roughly on the order of n^2 where n is the size of your data set.

A good example is a simple sort algorithm which runs in O(n^2), meaning
that if you double the number of points, you quadruple the time it takes
to sort them. A better sorting algorithm runs in O(n*log(n)).

The best example is the quadratic sieve* for factoring large numbers,
which runs in O(exp( n^(1/2) (log n)^(1/2) )). I was at a party
celebrating the expiration of the RSA patent and someone (I think it
was Lucky Green) went to the white board, wrote down this expression
and explained that this term meant that the program ran in worse than
polynomial time, but this other term meant that at it least ran in better
than exponential time. Meaning that the algorithm ran in "superpolynomial
subexponential runtime".

This led to the really silly song documented here:
http://www.xent.com/FoRK-archive/oct00/0429.html


(*Yes, yes, I know they were talking about the polynomial sieve, but
I couldn't find the runtime for that.)

--
-Ed Falk,
http://thespamdiaries.blogspot.com/
 
Reply With Quote
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      10-05-2010
In message <i8dsu7$nmg$>, Edward A. Falk wrote:

> In article <roy->,
> Roy Smith <> wrote:
>
>>Google for "Big-O notation". Depending on your level of interest,
>>expect to spend anywhere from an hour to the next four years reading
>>what pops out

>
> Yeah, that's my problem with Wikipedia too.


Which part of “level of interest” didn’t you understand?
 
Reply With Quote
 
Niklasro
Guest
Posts: n/a
 
      10-05-2010
On 4 Okt, 20:38, Tobiah <t...@rcsreg.com> wrote:
> It gets used here frequently, but not
> having majored in programming, I'm not
> familiar with it. *One might say:
>
> Don't do it that way, it will result in O(n**2)!
>
> Or something like that. *I read this to mean
> that the execution time varies with the square
> of the number of iterations, or items being sorted
> etc..
>
> I want to google this, but I'm not sure what
> keywords to use. *Is there a wikipedia article about this
> subject? *I imagine that it has a concise name.
>
> Thanks,
>
> Tobiah


Big O relates input size to computation time. For example mission is
"make the program 1000 times faster"
you can
a) buy much more expensive hardware
b) rewrite exponential time algorithms to polynomial time and
likewise.
And look at a sheet with 10 best algorithms, they have times noted and
where applicable for example sorting a set that's already somewhat
sorted another method than sorting a very unsorted set is applicable.
Regards,
Niklas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
How to convert Infix notation to postfix notation Tameem C Programming 441 11-30-2009 08:07 AM
Hungarian Notation Vs. Pascal Notation? Grey Squirrel ASP .Net 6 03-21-2007 09:42 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57