You are currently browsing the STARS at MEDAL blog archives for June, 2012


More on game of life

I prepared a small modification to the code that is able to track the percentage of cells that changed their state from the previous time step (shown as the last column). The modifications are not significant, you should look at “num_changed” throughout the code to track them. A link:

http://ideone.com/BVRez

I’d like to see some variants of the code with rule modifications by Monday morning. The most challenging but also interesting one would involve more types of living cells, e.g. 2. This would create an opportunity for all kinds of new rules and behaviors, but would also require you to modify the code to track not only the number of living and dead cells, but also the number of cells of each type (or percentage in terms of the number of living cells). The code modification will also require the neighbors to be not only counted, but the system needs to make a count of the different neighbor types.

Example worksheet with the results

Here’s the second program for doing simulations of the game of life:
http://ideone.com/6NXB8

This version is capable of executing multiple runs, and averaging the results. We will go through the details of the changes, and then show how we can visualize the results in Excel. An example worksheet is shown below (download this and view it). A similar thing can be done in OpenOffice.
http://stars.martinpelikan.net/wp-content/uploads/2012/06/example1.xlsx

http://www.math.cornell.edu/~lipa/mec/lesson6.html

Pages about game of life and its variants

Wikipedia page on the basic game of life:
http://en.wikipedia.org/wiki/Conway’s_Game_of_Life

Here’re a few pages about variations of Conway’s game of life:
http://en.wikipedia.org/wiki/Life-like_cellular_automaton

http://www.mirekw.com/ca/whatis_life.html

Assignment 5

This assignment is due by the next learning session on Monday, June 25, 2012. Please complete the programs on ideone.com, and send me the links to your programs via email at martin@martinpelikan.net.

Program A10:
Solve problem 7 from projecteuler.net. Submit the solution directly on the projeuler.net site so that you get it verified, and send me the link to the program you used to compute the solution (just like for previous problems).

Program A11:
Solve problem 9 from projecteuler.net. Submit the solution directly on the projeuler.net site so that you get it verified, and send me the link to the program you used to compute the solution (just like for previous problems).

Code from learning session 6

Here’s a link to the code from learning session 6:

http://ideone.com/pelikan/session_6

Code from learning session 5

Here’re the codes from today’s learning session:

http://ideone.com/pelikan/session_5

Assignment 4

This assignment is due by the next learning session on Wednesday, June 20, 2012. Please complete the programs on ideone.com, and send me the links to your programs via email at martin@martinpelikan.net.

Program A8:
Solve problem 5 from projecteuler.net. Submit the solution directly on the projeuler.net site so that you get it verified, and send me the link to the program you used to compute the solution (just like for previous problems).

Program A9:
Solve problem 6 from projecteuler.net. Submit the solution directly on the projeuler.net site so that you get it verified, and send me the link to the program you used to compute the solution (just like for previous problems).

Code from learning session 4

Code from today’s learning session can be found here:

http://ideone.com/pelikan/session_4

Technical Writing for Fun and Profit

David E. Goldberg was my Ph.D. advisor, and was excellent at writing. He wrote a short article Technical Writing for Fun and Profit on technical writing, please read this, it should be helpful in writing a good report. The article can be found at

http://ise.illinois.edu/ge494/technl-writing-fun.pdf

Assignment 3

This assignment is due by the next learning session on Monday, June 18, 2012. Please complete the programs on ideone.com, and send me the links to your programs via email at martin@martinpelikan.net.

Program A5:
Solve problem 1 on projecteuler.net. You can verify the solution directly on projecteuler.net (once you create a login). There is no penalty for a wrong answer, so once you are done with the programming go ahead and try to submit the answer. If the answer does not match, try to correct your code and submit again. On a side, this problem can be solved using a paper and pencil, but I want you to actually implement it in C++, so that your program gives you the answer.

Program A6:
Find the largest number in the Fibonacci sequence that is smaller than 100,000 (one hundred thousand). That means, print out the number in the Fibonacci sequence that is smaller than 100,000 and at the same time the next number in the sequence is definitely at least equal to 100,000. Print the number out. (Hint: You should keep generating new terms in Fibonacci sequence until you hit 100,000 (or more), and then output the previous number before hitting 100,000).

Program A7:
Solve problem 2 on projecteuler.net. You can verify the solution directly on projecteuler.net (once you create a login). There is no penalty for a wrong answer, so once you are done with the programming go ahead and try to submit the answer. If the answer does not match, try to correct your code and submit again. Once you have solved A6, this should be a piece of cake.

Let me know if you have any questions as soon as you have them.