Assignment 1 Mac OS
As with Assignment #1, you're limited to a maximum of three late days on this assigment. Don't forget that the in-class midterm is scheduled for May 10, so we recommend starting this one early! Note: Please be sure you have Python 2.7.x installed on your system. The first release of Mac OS was in 1999. Their operating system has been mainly based around multimedia and graphics designing. Mac OS Lion 10.7 was the first of the OS X line-up to make the transfer from 32-bit to 64-bit. OS X is generally more advanced than windows as was designed for graphics and motion designers. Viscosity is written using completely native frameworks on both macOS and Windows, letting it perfectly integrate with your operating system and offer top performance. No memory and CPU hungry cross-platform frameworks are used: Viscosity offers a completely native user interface with no bloated web-application frameworks.
Q1. In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems. a. What are two such problems? b. Can we ensure the same degree of security in a time-shared machine as in a dedicated machine? Explain your answer?
Ans1: (a) Stealing or copying a user 's files; writing over another program 's (belonging to another user or to the OS) area in memory; using system resources (CPU, disk space) without proper accounting; causing the printer to mix output by sending data while some other user 's file is printing.
(b)
Probably we cannot assure the same degree of security in a time shared…show more content…
Batch
b. Interactive
c. Time sharing
d. Real time
e. Network
f. Parallel
g. Distributed
h. Clustered
i. Handheld
Ans5:
a. Batch. Jobs with similar needs are batched together and run through the computer as a group by an operator or automatic job sequencer. Performance is increased by attempting to keep CPU and I/O devices busy at all times through buffering, off-line operation, spooling, and multiprogramming. Batch is good for executing large jobs that need little interaction; it can be submitted and picked up later.
b. Interactive. This system is composed of many short transactions where the results of the next transaction may be unpredictable. Response time needs to be short (seconds) since the user submits and waits for the result.
c. Time sharing. This systems uses CPU scheduling and multiprogramming to provide economical interactive use of a system. The CPU switches rapidly from one user to another. Instead of having a job defined by spooled card images, each program reads its next control card from the terminal, and output is normally printed immediately to the screen.
d. Real time. Often used in a dedicated application, this system reads information from sensors and must respond within a fixed amount of time to ensure correct performance.
e. Network. Provides operating system features across a network such as file sharing.
f. SMP. Used in systems where there are multiple CPU’s each running the
Programming Assignment 1: Percolation
Write a program to estimate the value of the percolation thresholdvia Monte Carlo simulation.
Install a Java programming environment.Install a Java programming environment on your computer by followingthese step-by-step instructions for your operating system[Mac OS X·Windows·Linux]. After following these instructions you will have stdlib.jarand algs4.jarin your Java classpath:the former contains libraries for reading data from standard input,writing data to standard output, drawing results to standard draw, generating random numbers,computing statistics, and timing programs;the latter contains all of the algorithms in the textbook.
Percolation.Given a composite systems comprised of randomly distributed insulating and metallicmaterials: what fraction of the materials need to be metallic so that the composite system is an electrical conductor? Given a porous landscape with water on the surface (or oil below),under what conditions will the water be able to drain through to the bottom (or theoil to gush through to the surface)?Scientists have defined an abstract process known as percolationto model such situations.
The model.We model a percolation system using an N-by-N grid of sites.Each site is either open or blocked.A full site is an open sitethat can be connected to an open site in the top row via a chain ofneighboring (left, right, up, down) open sites.We say the system percolates if there is a full site in the bottom row.In other words, a system percolates if we fill all open sitesconnected to the top row and that process fills some opensite on the bottom row. (For the insulating/metallic materials example, the open sites correspondto metallic materials, so that a system that percolates has a metallic path from top to bottom, with full sites conducting.For the porous substance example, the open sites correspond to empty space through which water might flow, so that a system that percolates lets water fill open sites, flowing from top to bottom.)
The problem.In a famous scientific problem, researchers are interested in thefollowing question: if sites are independently set to be open withprobability p (and therefore blocked withprobability 1 − p), what is the probability that the system percolates?When p equals 0, the system does not percolate; when p equals 1,the system percolates.The plots below show the site vacancy probability p versus the percolationprobability for 20-by-20 random grid (left) and 100-by-100 random grid (right).
When N is sufficiently large, there is a threshold value p* suchthat when p < p* a random N-by-N grid almost never percolates, and when p > p*,a random N-by-N grid almost always percolates.No mathematical solution for determining the percolation threshold p*has yet been derived.Your task is to write a computer program to estimate p*.
Percolation data type.To model a percolation system, create a data type Percolation with the following API:
Corner cases. By convention, the row and column indices i and jare integers between 0 and N − 1, where (0, 0) is the upper-left site:Throw a java.lang.IndexOutOfBoundsExceptionif any argument to open(), isOpen(), or isFull()is outside its prescribed range.The constructor should throw a java.lang.IllegalArgumentException if N ≤ 0.

Performance requirements. The constructor should take time proportional to N2; all methods shouldtake constant time plus a constant number of calls to the union-find methods union(), find(), connected(), and count().
Monte Carlo simulation.To estimate the percolation threshold, consider the following computational experiment:

- Initialize all sites to be blocked.
- Repeat the following until the system percolates:
- Choose a site (row i, column j) uniformly atrandom among all blocked sites.
- Open the site (row i, column j).
- The fraction of sites that are opened when the system percolatesprovides an estimate of the percolation threshold.
For example, if sites are opened in a 20-by-20 grid according to the snapshots below,then our estimate of the percolation threshold is 204/400 = 0.51 because the systempercolates when the 204th site is opened.
By repeating this computation experiment T times and averaging the results,we obtain a more accurate estimate of the percolation threshold.Let xt be the fraction of open sites in computational experiment t.The sample mean μ provides an estimate of the percolation threshold;the sample standard deviation σ measures the sharpness of the threshold.
Assuming T is sufficiently large (say, at least 30), the followingprovides a 95% confidence interval for the percolation threshold:To perform a series of computational experiments, create a data type PercolationStatswith the following API.
The constructor should throw a java.lang.IllegalArgumentExceptionif either N ≤ 0 or T ≤ 0.The constructor should take two argumentsN and T, and perform T independentcomputational experiments (discussed above) on an N-by-N grid. Using thisexperimental data, it should calculate the mean, standard deviation, and the 95% confidence interval for the percolation threshold. Use standard random from stdlib.jar to generate random numbers;use standard statistics from stdlib.jar to compute thesample mean and standard deviation.
Analysis of running time and memory usage. Implement the Percolation data type using the quick-find data typeQuickFindUF.javafrom algs4.jar.
Assignment 1 Mac Os Catalina
- Use the stopwatch data type from stdlib.jar to measure the total running time of PercolationStats.How does doubling N affect the total running time?How does doubling T affect the total running time?Give a formula (using tilde notation) of the total runningtime on your computer (in seconds) as a single function of bothN and T.
- Using the 64-bit memory-cost model from lecture and Section 1.4,give the total memory usage in bytes (using tilde notation) that a Percolationobject uses to model an N-by-N percolation system.Count all memory that is used, including memory for the union-find data structure.
Mac Os Mojave
Please wait until after Tuesday's lecture (Analysis of Algorithms) to answer these questions.
Mac Os Download
Deliverables.Submit only Percolation.java (using the weighted quick-union algorithm as implemented in the WeightedQuickUnionUF class)and PercolationStats.java.We will supply stdlib.jar and WeightedQuickUnionUF.java.On this assignment, the only library functions you may call are those injava.lang, stdlib.jar, and WeightedQuickUnionUF.java.Also, submit a readme.txt file andanswer all questions. You will need to read the COS 226 Collaboration Policyin order to answer the related questions in your readme file.
Assignment 1 Mac Os 11
This assignment was developed by Bob Sedgewick and Kevin Wayne.Copyright © 2008.