You should know what the following classes are up to:
There exists a beautiful and yet undemonstrated conjecture in Mathematics that deals with the so-called trajectories of natural numbers. It is called Collatz conjecture or, alternatively, Half-Or-Triple-Plus-One (HOTPO).
Learn on Wikipedia what trajectories are all about and how you can compute them for each given natural N, supposedly ending up always in 1.
We ask you to design a distributed client/server computing architecture (see the figure below) whose plumbing is based on YARP to progressively verify the HOTPO conjecture. The clients will thus perform concurrent verifications running on a cluster of computers.
The Client is required to:
- Talk to the Server according to this protocol.
- The Client requests the Server to obtain a natural N and a threshold T to then give back the test outcome.
- Verify the pair (N,T). The test terminates successfully if, at any step, the trajectory of N becomes lower than or equal to T. Conversely, the test will not terminate; therefore, the Server is responsible for constantly monitoring the current state of pending requests.
The Server is required to:
- Communicate with the Clients according to this protocol.
- Handle a FIFO
of pending requests received from the Clients according to the following policy:
- At start-up, the counter CNT is initialized equal to 0.
- At each request received from Client Ci, CNT is increased and pushed back into FIFO, while the pair (CNT,HEAD-1) is provided to Ci, being HEAD the element stored at the top of FIFO.
- If the Client request contains the outcome of a test, then the Server removes the corresponding element from FIFO.
- Monitor periodically the content of FIFO in search of those elements which have not been removed since long. These elements might be possible counterexamples to the conjecture. It is sufficient to report the content of FIFO at a given rate.
A Bottle whose format is:
Header | Payload |
---|---|
vocab_req | N |
- vocab_req is a proper identifier.
- N corresponds to the natural whose previous test was successful, or is 0 at start-up.
A Bottle whose format is:
Header | payload |
---|---|
vocab_item | N, T |
- vocab_item is a proper identifier.
- N is the natural for which a test is required against the threshold T.
-
Students are required to follow these instructions:
- To start, fork the repository by clicking on the invitation link.
- Clone the repository to your computer.
- Fill in the code directory and commit changes to complete your solution.
- Push/sync the changes up to GitHub.
- Create a pull request on the original repository to turn in the assignment.
-
Reviewers are required to follow these instructions:
- Once created, you can then do code review with line-by-line feedback directly within the pull request. If students are allowed to submit corrections, they can push fixes up to their forks, which will be reflected in the pull request.
- Since we don't want any solutions in the original assignment repository, you should leave the pull request unmerged.
- When you're finished giving feedback, you can close the pull request and leave a 👍 (
:+1:
) in a final comment.