Education and Outreach Blog

« Back

HPCU Bi-Weekly Challenge: Precipitate Algorithm: A 'Recipe' for Success

RELEASE DATE:
March 31, 2014

TITLE:
Precipitate Algorithm: A 'Recipe' for Success

SUMMARY:
Algorithms are often thought of as recipes that programmers write for computers to follow.  This problem challenges you to create an algorithm for an established model and its data structure.

QUESTION:
Previous challenge problems have developed a model and data structure for simulating the behavior of particles colliding in an environment and precipitating.  These challenge problems are linked below:

http://hpcuniversity.org/students/weeklyChallenge/70/
http://hpcuniversity.org/students/weeklyChallenge/71/

Your task is to develop an algorithm for such a simulation.  The algorithm should be written in pseudocode, such that a human can easily read it, and such that it would not take much effort for a programmer to translate it into a procedural language like C, C++, Fortran, Java, or Python.

The algorithm should break tasks down into sub-tasks whenever possible and should utilize the data structure given.

An example algorithm is given below for finding the greatest common divisor of two numbers m and n, adapted from The Art of Computer Programming by Donald Knuth.

1.  [Ensure m is bigger] If n is greater than m, swap m and n.
2.  [Store remainder] Divide m by n, store the remainder in r.
3.  [Remainder 0?] If r is 0, the algorithm terminates with answer n.
4.  [Reduce] Store n's value in m, r's value in n, and loop back to step 1.

SOLUTION:
Will be posted April 7, 2014

LINK:
http://hpcuniversity.org/students/weeklyChallenge/72/

Comments
Trackback URL: