CS245

Overview

In this assignment you will work with a partner. The task is to produce two programs that do exactly the same thing (in slightly different ways.) One version in Go and the other using Elixir. Then, based on your experience with the programs answer the questions posed at the end of the assignment. I imagine that you will do the following:
  1. Find a partner
  2. With your partner, sketch out program flow for the Go and Elixir programs.
  3. Split work, one person do the program in Go, the other in Elixir (Alternately you could use paired programming. If you do this, I highly encourage you to switch off the person who is typing and the person who is thinking / researching.)
  4. Answer the summary questions.
You are not required to work with a partner. If you do not, then you must write the program in Elixir. There is a special set of summary questions a for people working solo. You should answer only those questions.

Perfect numbers

According to Wikipedia "in number theory, a perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. For instance, 6 has divisors 1, 2 and 3 (excluding itself), and 1 + 2 + 3 = 6, so 6 is a perfect number. ".

Perfect numbers are rare. There are only 51 known. They get big fast ... The first five are: 6, 28, 496, 8128 and 33550336. There are no known odd perfect numbers; it has not been proven that odd perfect numbers do not exist. Slightly less rare are numbers that are close to perfect.

Task 0

Find a partner.

Send the names of the two people in your group to gtowell@brynmawr.edu.

Task 1

Write programs in Elixir and Go that run with multiple threads to find perfect, and close to perfect, numbers. Your program need not be efficient (a brute force factorer is fine. That is, just get remainder of the target number with respect to every number less that that square root of the target. If the remainder is 0 it is a factor.). Since it is known that the smallest possible odd perfect number is greater than 101500 your programs may skip odd numbers. There may be odd numbers that are close to perfect. It is OK to miss these.

Program Requirements

Questions

Once you complete your programs, write short answers to the following questions. Please note that I am often asking you for opinions; so correctness is not an issue. Rather I am looking for well-thought statements based on you experience with writing these programs. Also, in all cases the portion of the response that address why is far more important than the part that address what. (For instance, suppose each response is worth 10 points, then what is worth no more than 1 or 2 points, why no less than 8 or 9.)

Questions for people who worked in Pairs

Questions for people who worked Individually

Electronic Submissions

Your submission will be handed in using the submit script.

If you write your program on computers other than those in the lab, be aware that your program will be graded based on how it runs on the department’s Linux server, not how it runs on your computer. The most likely problem is not submitting everything or hard coding file locations that are not correct on the Linux servers.

The submission should include the following items:

README:
This file should follow the format of this sample README
Names of both people in a group. You need only submit once.
Source files
All of them (you might have only one)
Data files used:
Be sure to include any non-standard data files uses. (Rare)
DO NOT INCLUDE:
Data files that are read from the class site. Do include any of your own data files.

Again: Once you have everything you want to submit in the a5 directory within /home/YOU/cs245/

  1. Go to the directory /home/YOU/cs245
  2. Enter /home/gtowell/bin/submit -c 245 -p 5 -d a5
If this worked you will get a message with the word "success". If you cannot achieve success and the deadline is approaching, send me email. We can set up a meeting to work out your problems. The email will establish that you intended to submit. Once you send the email, do not change the files that you were trying to submit.