The Naked Scientists
  • Login
  • Register
  • Podcasts
      • The Naked Scientists
      • eLife
      • Naked Genetics
      • Naked Astronomy
      • In short
      • Naked Neuroscience
      • Ask! The Naked Scientists
      • Question of the Week
      • Archive
      • Video
      • SUBSCRIBE to our Podcasts
  • Articles
      • Science News
      • Features
      • Interviews
      • Answers to Science Questions
  • Get Naked
      • Donate
      • Do an Experiment
      • Science Forum
      • Ask a Question
  • About
      • Meet the team
      • Our Sponsors
      • Site Map
      • Contact us

User menu

  • Login
  • Register
  • Home
  • Help
  • Search
  • Tags
  • Recent Topics
  • Login
  • Register
  1. Naked Science Forum
  2. General Science
  3. General Science
  4. What is an algorithm and how does it work?
« previous next »
  • Print
Pages: [1]   Go Down

What is an algorithm and how does it work?

  • 2 Replies
  • 5080 Views
  • 0 Tags

0 Members and 1 Guest are viewing this topic.

Offline Karen W. (OP)

  • Moderator
  • Naked Science Forum GOD!
  • *****
  • 31886
  • Activity:
    0%
  • Thanked: 41 times
  • "come fly with me"
What is an algorithm and how does it work?
« on: 05/03/2009 03:37:18 »
I have always heard it used and I think it has to do with groups of numbers, but I really don't know what it is, or how it works.
 
I would like to know what it is how it works...what Kind of things can it be used for etc...?
« Last Edit: 05/03/2009 03:49:21 by Karen W. »
Logged

"Life is not measured by the number of Breaths we take, but by the moments that take our breath away."
 



Offline RD

  • Naked Science Forum GOD!
  • *******
  • 9094
  • Activity:
    0%
  • Thanked: 163 times
What is an algorithm and how does it work?
« Reply #1 on: 05/03/2009 04:09:56 »
An algorithm is a fancy name for a list of instructions given to a computer: a.k.a. a computer programme.

Here is a simple flow diagram ...

 [ Invalid Attachment ]
 
http://www.thenakedscientists.com/forum/index.php?topic=19379
« Last Edit: 05/03/2009 04:13:19 by RD »
Logged
 

Offline techmind

  • Hero Member
  • *****
  • 934
  • Activity:
    0%
  • Thanked: 1 times
  • Un-obfuscated
    • techmind.org
What is an algorithm and how does it work?
« Reply #2 on: 05/03/2009 08:56:14 »
An algorithm is a fancy name for a method of doing something. It's often associated with mathematical or logical "recipies".
An algorithm is usually quite detailed (but doesn't necessarily have to be the case). It can be a bit like a computer program, but describes the principle of what you want to do and how to go about it without the formality and syntax of a real programming language.

A computer program is often a specific embodiment or implementation of an algorithm.

You can often express an algorithm as a flow chart, but it might be equally valid to express it as a series of numbered steps, with options to jump back or forward to other steps depending on conditions.


If you wanted to solve a maze by a "brute force" (ie unintelligent, but reliable) method you could use the rule of "always follow the left-hand wall" (as an aside this rule won't work for mazes with any bits of unconnected wall). This could be considered a very simple algorithm for getting out of a maze.



Here's an example of an algorithm for creating random dot stereograms (those 3D pictures):
 
1. Start with a "depth-map" - array of z-values for each (x,y) point on the screen.
2. Working left to right along each horizontal line, for each point on the depth-map identify the associated pair of screen points and `link' them - give each a reference to its other half.
3. Again working from left to right, assign a random colour to each unlinked point, and colour linked points according to the colour of their (already coloured) other half.

This is taken from my web page: http://www.techmind.org/stereo/stech.html and which might also give some idea of how a computer program relates to an algorithm (although it's moderately advanced).
« Last Edit: 05/03/2009 09:05:21 by techmind »
Logged
"It has been said that the primary function of schools is to impart enough facts to make children stop asking questions. Some, with whom the schools do not succeed, become scientists." - Schmidt-Nielsen "Memoirs of a curious scientist"
 



  • Print
Pages: [1]   Go Up
« previous next »
Tags:
 
There was an error while thanking
Thanking...
  • SMF 2.0.15 | SMF © 2017, Simple Machines
    Privacy Policy
    SMFAds for Free Forums
  • Naked Science Forum ©

Page created in 0.436 seconds with 31 queries.

  • Podcasts
  • Articles
  • Get Naked
  • About
  • Contact us
  • Advertise
  • Privacy Policy
  • Subscribe to newsletter
  • We love feedback

Follow us

cambridge_logo_footer.png

©The Naked Scientists® 2000–2017 | The Naked Scientists® and Naked Science® are registered trademarks created by Dr Chris Smith. Information presented on this website is the opinion of the individual contributors and does not reflect the general views of the administrators, editors, moderators, sponsors, Cambridge University or the public at large.