CSCI 111 - Chapter 3, 4, 5 Study Guide

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

A file directory is also called ___________

folder

For this forwarding purpose, each router maintains a _________________ table that contains the router's knowledge about the direction in which messages should be sent depending on their destination addresses.

forwarding

What is the role of the user interface of an operating system?

handles the communication with the operating system's users.

Using ______________, a server transmits a message to multiple clients by means of a single address and relies on the routers in the Internet to recognize the significance of that address and to produce and forward copies of the message to the appropriate destinations. N-Unicast Unicast anycast multicast

multicast

What is the role of the kernel of an operat- ing system

performs the fundamental tasks of the system.

Write an algorithm to take a positive integer n as input and produce the sum of 1+2+..+n. Your algorithm must use recursive control

procedure sum(n) if n is 1 return 1 return n + sum(n-1) end procedure

The activity of executing a program under the control of the operating system is known as a ____________.

process

In batch processing systems, the jobs residing in mass storage wait for execution in a job ________

queue

What bit pattern is represented by the following dotted decimal patterns? 8.12.20.13

00001000 00001100 00010100 00001101

describe three kind of distributed computing system

1- Cluster Computing: Many independent computers work closely to provide computation or services comparable to a much larger, single machine. It is cheaper, has faster internet, is more reliable, and has lower maintenance costs than a supercomputer. 2- Grid Computing: Systems are more loosely coupled than clusters but can work together for large tasks. Involves specialized software to make data and algorithm distribution easier. 3- Cloud Computing: Huge pools of shared computers on the network can be allocated for client use if needed and made available on the network for distributed computing on demand.

Design an algorithm for finding all the factors of a positive integer. For example, in the case of the integer 12, your algorithm should report the values 1, 2, 3, 4, 6, and 12.

1. A positive integer is inputted (x) 2. while(a number (n) is less than the positive integer (x)) 3. Then, if the positive integer (x) has no remainder after being divided by the number (n), it is then considered to be factorable and reported as a value. 4. After it (n) is either determined to be factorable or not, the number is incremented (n+1), and a loop occurs. 5. This loops until the number (n) is equal to the positive integer being inputted (x). 6. Everything reported as a value in step 3 is then considered to be a factor of the positive integer that was inputted in step 1 and printed as the output. To explain this in code: x is the given integer n = 1 while(n <= x): { if(x%n==0): { x = x/n; print(x) } n= n + 1; } Output: 12 6 4 3 2 1 (if x == 12) This could also be written as x is the given integer n = x; //n is x's value while(n > 0): #as long as n is greater than 0, this will loop, and when decremented, it will come to a stop when n = 0 { if(x%n==0): x = x/n; print(x) } n = n - 1; #decrements by 1 instead of increments } Output: 1 2 3 4 6 12 (if x == 12)

List four activities of a typical operating system.

1. Control data and its access 2. provide for efficient device access 3. coordinate the use of the machine's resources 4. control access to the machine.

Design an algorithm that, when given an arrangement of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, rearranges the digits so that the new arrangement represents the next larger value that can be represented by these digits (or reports that no such rearrangement exists if no rearrangement produces a larger value). Thus 5647382901 would produce 5647382910.

1. Start from the right end of the arrangement of the digit, find the first digit that is smaller than the one to its right 2. If the digit does not exist, the digits arranged have reached the largest value the digits can be arranged to. 3. The position where the digit is found is called the target position in the input. 4. This digit is then changed with the smallest digit to its right (and is till larger than the digit found in the previous step). 5. The digits to the right of the target position are then sorted in descending order from right to left

Write a set of directions that tells an operating system's dispatcher what to do when a pro- cess's time slice is over.

1. The current process's state is saved 2. Another process from the process table is selected 3. That newly slected process's state is loaded 4. The next time slice is started

List in chronological order the major events that take place when a process is interrupted.

1: CPU receives interrupt signal 2: Completes current machine cycle 3: Saves its position in current process 4: Begins executing interrupt program called interrupt handler

Encode the following bit patterns using dotted decimal notation: 000001010001001000100011

5.18.35

Suppose a computer contained 512MB (MiB) of main memory, and an operating system needed to create a virtual memory of twice that size using pages of 2KB (KiB). How many pages would be required? (Only write down the number)

524,288

Suppose the address of an end system on the Internet is quoted as 134.48.4.122. What is the 32-bit address in hexadecimal notation?

8630047A

What is a DNS lookup?

A DNS lookup is the process of using the domain name system to translate a domain name into the corresponding IP address or vice versa.

What is the hidden terminal problem? Describe a technique for solving it.

A hidden terminal problem is when signals from different machines cannot communicate as they are blocked by objects or distance. One good thing is that they can all communicate with the central AP, so one approach to solving the problem is to have each machine send a short request to the AP and wait to receive an acknowledgment before transmitting an entire message. All devices will be able to hear the declaration.

How does a hub differ from a repeater?

A hub is a central location where devices connect to. It relays any signal it receives back out to all the machines connected to it, creating what looks like a star network but operates like a bus network. A repeater, however, passes signals back and forth between two original buses, creating an even larger network.

What is the difference between a process that is ready and a process that is waiting?

A process that is ready is in a state in which its progress can continue and could make progress if given a time slice, while a process that is waiting is delayed and cannot progress until some external event occurs.

What information is contained in the state of a process?

A process's state includes the values in the CPU's registers (including the program counter) as well as the contents of its associated memory cells.

What is a protocol? Identify three protocols introduced in this chapter and describe the purpose of each.

A protocol is a set of rules established so a network can function correctly. 1- Carrier Sense, Multiple Access with Collision Detection (CSMA/CD): Dictates that each message is broadcasted to all machines that are on the bus. When transmitting messages, CSMA/CD monitors the transmissions to detect collisions. Requires a pause before retransmitting a message. 2- Carrier Sense, Multiple Access with Collision Avoidance (CSMA/CA): Does not detect collisions but avoids them. If collisions do occur, messages must be retransmitted, however, with a brief waiting period in the order they have been waiting. 3- Simple Mail Transfer Protocol (SMTP): Defines a method so two or more computers on a network can communicate. This communication method is done through email, where one end user communicates with another end user. The server process at one end must identify itself to the other end and vice versa!

What is a proxy server and what are its benefits?

A proxy server is a software unit that acts as an intermediary between a client and a server. A proxy server keeps clients from directly communicating with servers, which keeps the server from learning a certain amount about the client, keeping them safe from the server's inappropriate behavior.

How does a router differ from such devices as repeaters, bridges, and switches?

A router connects two networks, forming an internet, while each network still maintains its unique internal characteristics. Repeaters, bridges, and switches, however, connect networks in order to form a larger network.

Does the following program represent an algorithm in the strict sense? Why or why not? Count = 0 while (Count != 5): Count = Count + 2

Algorithims must have an end, so since this is an infinite loop since count will never equal 5, in a strict sense, this is not an algorithm. However, if count were to equal 1 at the beginning of the program instead of 0, it would have equaled 5, thus the program would've ended and it could have represented an algorithm.

Which of the following lists would be obtained after third iteration of the outer while loop when applying the insertion sort algorithm to the list below Sylvia Nancy Lois Alice Lois Nancy Sylvia Alice Nancy Sylvia Lois Alice Alice Lois Nancy Sylvia Alice Sylvia Nancy Lois

Alice Lois Nancy Sylvia

What is the difference between an open network and a closed network?

An open network is based on designs in the public domain, while close networks are based on innovations owned and controlled by a particular entity, i.e., individuals or corporations. Unlike closed networks, open networks are freely circulated. Applications are not restricted by license fees and contract conditions so that public knowledge can be used without specific permission from an owner. An example of an open network is the Internet.

Four prospectors with only one lantern must walk through a mine shaft. At most, two prospectors can travel together and any prospector in the shaft must be with the lantern. The prospectors, named Andrews, Blake, Johnson, and Kelly, can walk through the shaft in one minute, two minutes, four minutes, and eight minutes, respectively. When two walk together they travel at the speed of the slower prospector. How can all four prospectors get through the mine shaft in only 15 minutes? After you have solved this problem, explain how you got your foot in the door.

Andrews and Blake go through the shaft first, taking 2 minutes. Andrews returns to the other two prospectors, taking 1 minute. Johnson and Kelly go through the shaft, taking 8 minutes. Blake brings the lantern back, taking 2 minutes, Andrews and Blake go through the shaft, meeting up with the others, 2 minutes.

Preconditions, postconditions, and loop invariants are examples of which of the following? Pseudocode recursion Assertions Iterative structure

Assertions

Summarize the distinction between batch pro- cessing and interactive processing.

Batch processing refers to the process of collecting a program (or programs) together with data and submitting this material to the operating system for execution (perhaps at a later time) without further intervention by the user. Interactive processing refers to the technique of executing a program in a manner that allows the user to communicate with the program during its execution.

_________ computing describes a distributed system in which many independent computers work closely together to provide computation or services comparable to a much larger machine.

Cluster

Rewrite the following program segment using a while structure rather than a repeat structure. Be sure the new version prints the same values as the original. Count = 1 repeat: print(Count) Count = Count + 1 until (Count >= 7)

Count = 1 while (Count <= 6): print(Count) Count = Count + 1

Rewrite the following program segment using a repeat structure rather than a while structure. Be sure the new version prints the same values as the original. Count = 2 while (Count < 7): print(Count) Count = Count + 1

Count = 2 repeat: print(Count) Count = Count + 1 until(Count >= 7)

Which of the following components of an operating system handles the details associated with particular peripheral equipment? Device drivers File manager Memory manager none of the above

Device drivers

What is the difference between embedded sys- tems and PCs?

Embedded systems are typically dedicated to specific tasks, whereas PCs are general purpose computer systems capable of many different tasks. Embedded systems are often characterized by more limited resources, stricter deadlines, and narrower channels for human interaction than PCs.

A top-down methodology progresses from the specific to the general. True False

False

Which of the following is part of operating system? application software utility software GUI kernel

GUI kernel

Describe the peer-to-peer model.

Just like the client/server model, the peer-to-peer model (aka P2P) is used for interprocess communication. The peer-to-peer model involves processes that provide service to one process and receive service from another process, unlike the client/server model, which only involves one process. The peer-to-peer model also usually consists of a process that is executed temporarily!

What is the difference between virtual mem- ory and main memory?

Main memory is memory that is actually present in the machine. Virtual memory is "fictional" memory space whose presence is merely simulated by swapping blocks of data back and forth between a disk.

Describe the client-server model.

The client-server model is used for interprocess communication, which is communication between two processes, client and server. The client process makes requests of other processes, while the server process satisfies the requests to the print server.

What is the distinction between a network and an internet?

Networks have computers connected to transfer data from one machine to another. On networks, computers exchange information, share resources that are scattered across the global system. An internet, however, builds a network of networks. Networks can communicate with one another while having each network maintain their individuality and continue to function as autonomous networks, even if another network (Ethernet network, for example) is different from another (WiFi network, for example).

Which of the following isn't a functionality of a operating system? Store and retrieve files Schedule programs for execution Coordinate the execution of programs None of the above

None of the above

When searching within the list Lewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger, Stan, Tom which of the following entries will be found most quickly using the binary search algorithm? Stan Mary Lewis Pat

Pat

What is the difference between a formal programming language and a pseudocode?

Psedocode is a notational system in which ideas are expressed informally during the algorithm process. Formal programming language, however, has strict rules of grammar that muust be obeyed.

Summarize the principles of public-key encryption.

Public-key encryption involves decrypting and encryption messages for them to remain secure. This consists in using two keys: the public key and the private key. The publicly known key encrypts messages, while the private decoding key focuses on deciphering the message.

Suppose three items R, S, and T are placed in a queue in that order. Then one item is removed from the queue before a fourth item, X, is placed in the queue. Then one item is removed from the queue, the items Y and Z are placed in the queue, and then the queue is emptied by removing one item at a time. List all the items in the order in which they were removed.

R, S, T, X, Y, Z

Why is the booting process necessary?

Since most of a computer's main memory is volatile, the operating system must be reloaded each time the machine is turned on.

Write an algorithm to take a positive integer n as input and produce the sum of 1+2+..+n. Your algorithm must use while loop control

Sum is equaled to 0 Count is equaled to 1 while(count is less than or equal to n): count is added to sum count is incremented by 1 the while loop stops when count is greater than n the sum is printed Can be written as: sum = 0 count = 1 while(count <= n): sum = sum + count count = count + 1 print(sum)

What is the difference between syntax and semantics?

Syntax refers to the symbolic representation of a primitive and the way it is expressed, while semantics refers to the meaning of the primitive and how it is expressed.

Identify the body of the following loop struc- ture and count the number of times it will be executed. What happens if the test is changed to read "(Count != 6)"? Count = 1 while (Count != 7): print(Count) Count = Count + 3

The body of the loop executes twice, but when Count != 7 is changed to Count != 6, it turns into an infinite loop, which will never terminate.

If a computer's mnemonic Internet address is batman.batcave.metropolis.gov what might you conjecture about the structure of the domain containing the machine?

The computer batman, is in the subdomain batcave within the domain metropolis within the top-level domain .gov.

Suppose you wanted to establish a firewall to filter out email messages containing certain terms and phrases. Would this firewall be placed at your domain's gateway or at the domain's mail server? Explain your answer.

The firewall (one that filters out email messages containing specific terms and phrases) should be placed at the domain's mail server. If it were placed at the domain's gateway, it would not be used as the gateway only filters its content by a packet's address information, not by its contents

What information is contained in a process table within an operating system?

The status of each process (ready, waiting) and the priority of each process.

In what sense do the following three steps not constitute an algorithm? Step 1: Draw a straight line segment between the points with rectangular coordinates (2,5) and (6,11). Step 2: Draw a straight line segment between the points with rectangular coordinates (1,3) and (3,6). Step 3: Draw a circle whose center is at the intersection of the previous line segments and whose radius is tw

This is not an algorithm since Step 3 is not able to be executed due to Step 1 and Step 2 not intersecting. If they did intersect, this would be considered an algorithm since Step 3 would be able to execute and draw a circle with its center being at the intersection of Step 1 and Step 2. However, this is not the case.

The following program segment is designed to compute the product of two nonnegative integers X and Y by accumulating the sum of X copies of Y; that is, 3 times 4 is computed by accumulating the sum of three 4s. Is the program segment correct? Explain your answer. Product = 0 Count = 0 repeat: Product = Product + Y Count = Count + 1 until (Count == X)

This program segment is not correct, because the algorithm will not get the correct answer when X = 0.

A multitasking operating system is an operating system that allows several activities to execute "at the same time."

True

The peer-to- peer model involves processes that provide service to and receive service from each other True False

True

What URL stands for?

Uniform Resource Locator

A computer network is often classified as being either a PAN, a LAN, a MAN, or a ____________.

WAN

What letters are interrogated by the binary search (Figure 5.14) if it is applied to the list A, B, C, D, E, F, G, H, I, J, K, L, M, N, O when searching for the value J? What about search- ing for the value Z?

When searching for J: H, L, J When searching for Z: H, L, N, O

Which of the following is a loop invariant at the point at which the test for termination is performed in the following loop structure? X = 3 while (X < 5): X = X + 2 X ≥ 5 X > 5 X ≤ 5 X < 5

X ≤ 5

Write the following path: X is a directory containing the subdirectory Y, which contains the subdirectory Z.

X/Y/Z

Each time the dispatcher awards ____ time slice to a process, it initiates a timer circuit that will indicate the end of the slice by generating a signal called an interrupt.

a

Which of the following is an Internet application protocol? Telnet http FTP all of above

all of above

Which of the following is NOT a means of repeating a block of instructions? assignment statement recursion posttest loop pretest loop

assignment statement

The overall process of executing the boot loader and thus starting the operating system is called __________ the computer.

booting

One way of classifying networks is based on the topology of the network, which refers to the pattern in which the machines are connected. Two of the more popular topologies are the ________ and star.

bus

A primary prevention attack technique is to filter traffic passing through a point in the network, usually with a program called a ______.

firewall

A process is ________ if its progress is currently delayed until some external event occurs, such as the completion of a mass storage operation, the pressing of a key at the keyboard, or the arrival of a message from another process.

waiting

In general, an algorithm in which of the following categories is considered more efficient? Θ(log2 n) Θ(n) Θ( n2 ) Θ(n log2 n)

Θ(log2 n)


Set pelajaran terkait

OBHR 3330 Exam 3- Quiz's & Notes Ch. 8-10.

View Set

ma maison presentation questions

View Set

rn 400 week 5 hw: generalized anxiety disorder

View Set

intermediate accounting 2- final exam

View Set