Operating Systems–1: CS3510 Solved

$ 29.99


Programming Assignment 1: Computation of
Collatz Numbers
Goal: Solve the programming problem 3.21 given in the 10th Edition of the book. In this assignment, you will develop a multi-process program that develops the sequence of collatz numbers for a given positive integer n.
Details: The Collatz conjecture concerns what happens when we take any positive integer n and apply the following algorithm:
n={ n/2,if niseven }
3×n+1,if nisodd
The conjecture states that when this algorithm is continually applied, all positive integers will eventually reach 1. For example, if n = 35, the sequence is: 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1
You have to write a C program that uses the fork() system call to generate this sequence in the child process. The starting number will be provided from the command line. For example, if 8 is passed as a parameter on the command line, the child process will output 8, 4, 2, 1. Because the parent and child processes have their own copies of the data, it will be necessary for the child to output the sequence. Have the parent invoke the wait() call to wait for the child process to complete before exiting the program. Perform necessary error checking to ensure that a positive integer is passed on the command line.
Report Details: As a part of this assignment you have to prepare a report which will describe the low-level design of your program and give an analysis of its output.
Submission Format
You have to upload: (1) The source code in the following format: Assgn1Src-<RollNo>.c (2) Readme: Assgn1Readme-<RollNo>.txt, which contains the instructions for executing the program.
(3) Report: Assgn1Report-<RollNo>.pdf. Name the zipped document as: Assgn1-<RollNo>.zip
Please follow this naming convention. Otherwise, your assignment will not be graded.
Grading Policy: The policy for grading this assignment will be –
(1) Design as described in report and analysis of the results: 50%; (2) Execution of the tasks based on description in readme: 40% (3) Code documentation and indentation: 10%.


There are no reviews yet.

Be the first to review “Operating Systems–1: CS3510 Solved”

Your email address will not be published. Required fields are marked *