Giter Site home page Giter Site logo

test-collatz-conjecture-with-yarp-arya's Introduction

Message Passing with YARP

Prerequisites

You should know what the following classes are up to:

Preamble

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.

Assignment

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.

architecture

Client Side

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.

Server Side

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:
    1. At start-up, the counter CNT is initialized equal to 0.
    2. 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.
    3. 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.

Protocol

Client ➡️ Server request

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.

Server ➡️ Client response

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.

How to complete the assignment

  • Students are required to follow these instructions:

    1. To start, fork the repository by clicking on the invitation link.
    2. Clone the repository to your computer.
    3. Fill in the code directory and commit changes to complete your solution.
    4. Push/sync the changes up to GitHub.
    5. Create a pull request on the original repository to turn in the assignment.
  • Reviewers are required to follow these instructions:

    1. 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.
    2. Since we don't want any solutions in the original assignment repository, you should leave the pull request unmerged.
    3. When you're finished giving feedback, you can close the pull request and leave a 👍 (:+1:) in a final comment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.