Suppose we have a system of 3 processes named A, B and C. A sends two messages to C- the message contents being 1 and 2 respectively. Similarly B sends 2 messages to C; the contents being 3 and 4 respectively. Process C simply keeps doing this: receive a message and print it. (a) Assuming all the default assumptions, what possible outputs will be generated by C? (By "output" we mean the entire sequence of numbers printed by Cin a complete run of the system. Note that several different sequences are possible in different runs.) You can enumerate these sequences or describe them precisely in words. (b) Assuming that the communication lines are non-FIFO, what would be your new answer?
Q: Consider a computer system that has 8 identical resources and P processes competing for them. Each…
A: least dead lock is
Q: Write a c++ program to calculate Completing Time (CT), Turn Around Time (T AT), Response Time(RT),…
A: Note: As you have asked multiple questions, as per our policy we will solve the first question for…
Q: Suppose a program has four conditional execution states (it does one of four things, depending on…
A: The weighted average of the response time is: 0.60 x 50 + 0.24 x 172 + 0.12 x 1400 + 0.04 x 3400 =…
Q: Practice 1 Given the string of numbers below: {23, 4, 8, 33, 25, 7, 12, 6, 49, 50, 11, 20, 21, 24,…
A: The complete code is given below.
Q: Consider a system consisting of m resources of the same type being shared by n processes, n > m.…
A: Deadlock free condition is: R ≥ P(N−1) + 1 Where R is total number of resources, P is the number of…
Q: 1. Consider machines which accept a stream of 1 or more bits (the alphabet is limited to l's and…
A: - We will use the 'or', 'and' and 'xor' operators for this problem.
Q: Consider the following concurrent program. Initially a, b and c are 0. a:=1 ; print (b) ; print (c);…
A: According to question above of concurrent program refer below: Initially for P1: a=1,b=0,c=0 thus…
Q: Answer the following questions using the banker’s algorithm: How many instances of resources are…
A:
Q: Let I represent an execution of init(s), W of wait(s), and S of signal(s). Then, for example, IWWS…
A: Let I represent an execution of init(s), W of wait(s), and S of signal(s). Then, for example, IWWS…
Q: Scenario: You are tasked with the development of an E-Scooter ride-share system. It allows…
A: ROLES: Scooters, especially e-scooters, allow anybody to ride for short excursions regardless of…
Q: Problem Solving. Consider the code below: Shared var X: integer; {initialized to 5} Process A…
A: Defined the given problem
Q: On a real computer system, neither the resources available nor the demands of processes for…
A: a) Increase Available (new resources added): Increasing available, i.e increasing the number of…
Q: Write a program that consists in three processes to print the message "ping-pong" two times on…
A: ANSWER:-
Q: A complete C program that counts the number of even and odd integers provided from the command line.…
A: #include <stdio.h> // Driver code int main(){ int d;scanf("%d",&d);int a[d];for(int…
Q: Answer the following questions using the banker’s algorithm: How many instances of resources are…
A: How many instances of resources are present in the system under each type of a resource? => Total…
Q: Given the string of numbers below: {23, 4, 8, 33, 25, 7, 12, 6, 49, 50, 11, 20, 21, 24, 35} Create a…
A: C program to create a child process using fork() and print odd numbers present in the given array…
Q: The following pair of processes share a common variable X. Process A int Y; A1: Y=X*2: A2: X = Y;…
A: A Process is a series of actions, motions, or operations leading to some result the manufacturing…
Q: Computer Science Complete the program 'Ring-1.c' to make the program work well for any number of…
A: The code for c languae is
Q: Consider the behavior of two machines in a distributed system. Both have clocks that are supposed to…
A: Actually, given information 1000 times per millisecond. 990 times per millisecond.
Q: Design a Turing machine that takes as input a number N and adds 1 to it in binary. To be precise,…
A: Here, I have to provide a solution to the above question.
Q: Consider a system with four resources of the same kind shared by three processes, each of which…
A: We can show that contradiction frees the system from deadlock: 1) When a system is deadlocked, it…
Q: Given two READY processes, one CPU-bound and the other VO-bound, which process should be given…
A: Next-to-run processes with a high priority As high priority should be given to the input/output…
Q: Suppose there are three processes A, B and C. All clock runs at the same rate but initially A’s…
A: Answer (a): A will sends message to B from 10 to 0, but it takes 4 units. So it will receive on B's…
Q: We want to connect the output of a child process to the write end of the pipe p. Which of the…
A: To connect of a child process to the write end of the pipe p
Q: Write a C program that consists in two processes to print the message "XO" multiple times on screen.…
A: According to the asked question, the solution is given below with a proper explanation. The Given…
Q: In the homework we saw Turing machines for AND, OR, NOT. Here's the definition for XOR. q® 0 B q1 q1…
A: detail ans is given in following stpes:
Q: Write a c++ program to calculate Completing Time (CT), Turn Around Time (T AT), Response Time(RT),…
A: Since you are asking multiple questions , we are answering first one for you. If you want solution…
Q: Question 4) Consider the following two processes P1 and P2, to be run concurrently in a shared…
A: Two processes, P1 and P2, need to access a critical section of code. Consider the following…
Q: c) Give two separate examples when a process changes its state to waiting and ready from the running…
A: We are asked a beautiful question on process state diagram in operating system where we will…
Q: b) Consider the following three-process concurrent program which uses semaphores S1, S2, and S3:…
A: Answer: I have written answer in the handwritten format.
Q: In the case of two processes in the READY state, one of which is CPU-bound and the other of which is…
A: Almost all programs have some alternating cycle of CPU number crunching and waiting for I/O of some…
Q: If the execution times of P1, P2, P3, and P4 processes are 50, 30, 90, and 80, respectively, and the…
A: Given, Execution time of P1=50 Execution time of P2=30 Execution time of P3=90 Execution time of…
Q: Develop a program in C to create three processes A, B and C. Job of these individual processes are…
A: Answer: I have done code and also I have attached code as well as code screenshot.
Q: The following pair of processes share a common variable X. Process A int Y; A1: Y = X*2; A2:…
A: Question. The following pair of processes share a common variable X. Process A int Y; A1: Y =…
Q: Is it possible for a single process to get stuck at some point during its execution? Your responses…
A: Introduction: A deadlock occurs when many processes wanting to access a resource that is presently…
Q: Is the following concurrent execution sequentially consistent? write(a,1), read(b,0), computer 1:…
A: Sequential concurrent execution: for the given operation we have to form a graph to check for any…
Q: Write a program that consists in three processes to print the message "ping-pong" two times on…
A: C code :- #include<stdio.h>#include<mpi.h> #define proc_A 0#define proc_B 1#define ping…
Q: Write a C program to create two processes. Proccess 1 takes a string and passes it to Proccess 2.…
A: Here is the C Code: #include <stdio.h>int main(void) {int fd[2],fd1[2] ,cpid,nbytes;…
Q: Consider the schedules S, and S, given below. Draw the precedence graphs for S, and S, and state…
A: Introduction:Given two schedules as follows,using precedence graph we have to find out whether these…
Q: Consider P0,P1,P2 are three processes synchronised with semaphores S0=1,S1=0,S2=0 as shown…
A: 0 1 process P1 executes first, as S1=0 it would not execute similarly P2 now P0 executes and prints…
Q: You have given a task to allocate the resources to the process, every student have their Reg no as…
A: Actually, given information: You have given a task to allocate the resources to the process, every…
Q: In we need to make sure that two or more processes that are running on the same machine do not…
A: A process is program in execution and for that processor takes it does its job by execution It…
Q: We are given three (primitive) processes P1, P2, and P3 with shared integer variable x and local…
A: Given: Pi executes ten times the assignment x := x + 1. Consider now the parallel program P = P1 ||…
Q: Consider a computer environment in which there are 4 magnetic drives, 2 printers, 3 scanners, and 1…
A: Deadlock: A deadlock is a condition where a program cannot access a resource it needs to continue.…
Q: Write a C program to create two processes P1 and P2. P1 takes 2 integers (x, y) and passes it to P2.…
A: A process is an executing program. When a program is compiled, it converts into a binary code.…
Q: Write a program that consists in three processes to print the message “ping-pong” two times on…
A: import java.util.Scanner;package pingpongdriver; class PingPong implements Runnable{ //Private…
Q: Consider Process P1 is in Running state and Process P2 is in Ready state. Due to 1/O operation or…
A: Ready state: After the creation of a process, the process enters the ready state. In this state, the…
Q: In the picture attached, the Say that the system is running 3 jobs, A, B, and C, and that all…
A: Each cycle in a PC system requires some measure of time for its execution. The CPU time is the time…
Q: Scooter to commute a certain distance (that is not known
A: Please check the step 2 for solution
Q: Suppose we have three processes P0, P1, and P2. Process P0 executes statement S0 and process P1…
A: L0=1, L1=0, L2=0 P2 P1 P0 While(true){ wait(L0); executes statement S2 signal(L1); signal(L2);…
Step by step
Solved in 2 steps
- vvvHarry has a big wall clock, that got hit while he was playing. Now, the minute hand doesn't rotate by the angle 2π/3600 each second, but now it moves according to different angle x. You can assume that coordinates of the centre of the clock are (0, 0) and the length of the minute hand is l. One endpoint of the minute hand is always located at the clock centre; the other endpoint is initially located at the point (0, l). One second later, Harry observes that this endpoint is at distance d above the x-axis, i.e., the y-coordinate of this endpoint is equal to d. Harry is curious about where the minute hand will be (specifically, its y-coordinate) after t seconds. Because t can be very large, Harry can't wait for that moment. Please help him to write a python code that prints a single line containing the output.Input: 4 2 2Output4Harry has a big wall clock, that got hit while he was playing. Now, the minute hand doesn't rotate by the angle 2π/3600 each second, but now it moves according…2. Define the function O(k), with k > 2, as 22 + 4? + 62 + ·..+ m? where m is the largest even number that is < k. Please implement the function in MIPS and make sure your implementation indeed works on the simulator, by printing the value O(15) to the terminal.Hi! This is not a graded question I just need it for my reviewer. Thanks! 2.Recall that a public-key cryptosystem consists of three functions: A key generator G, an encryption function E, and a decryption function D. Any user, say Alice (A), can use the key generator to generate a key pair (PKA, SKA), in which PKA is Alice’s public key, and SKA is her secret key; she can then publish her name and public key in a directory. Subsequently, anyone who wants to send a private message x to Alice can look up PKA in the directory, compute a ciphertext y ←− E(x, PKA), and send y to Alice over an open line. Only Alice can compute x ←− D(y, SKA), because only she knows the decryption key SKA that corresponds to encryption key PKA. Note that there is no need for a key-distribution center, as there is when one is using a symmetric-key cryptosystem, but there is a need for public-key directories. a) What is a public-key certificate? What is the problem with public-key directories that certificates…
- The same professor writes a program to analyze the chat logs from the various lectures as a partial measure of class participation. Each chat log consists of multiple lines, each of form TIME, NAME, COMMENT, in the order in which they were posted to the chat . The algorithm then sorts all that data - across all the chat logs - in order of student names, and scores each set using a metric based on the number of contributions and their length. [a] What are the various input sizes to consider when analyzing the algorithmic approaches? (One is the number of students in the class, but that is not the only factor.) [b] Which sorting algorithm do you think is best suited for the sorting portion of this algorithm and why? [c] What is the time complexity of the sorting algorithm chosen in step [b] as a function of the various input sizes identified in step [a]? [d] What is the overall time complexity of the chat analysis program as described above?Implement SRTF (SJF with preemption) scheduling algorithm in C programming. NOTE: Please do not print the average waiting time and the average turnaround time. You are required to compute these for each process and print the values for each process separately. Add comments in the code so that the code is understandable. Take input from the user: the number of processes, their CPU burst times and arrival times for n number of processes. Compute and print the completion Time(CT), Turnaround Time(TAT), and Waiting Time(WT) for each process using C ProgrammingSuppose a train was supposed to start at station A, pause at stationsB, C, D, ... , Y, and finish at station Z. However, it did not arrive at Z. Suppose in yourfactory the piece of equipment or process labeled A makes part B work, which in turnmakes C, D, ... , and Z work. However, Z is not working. You want to find out why.What algorithm do you use? Think of other applications of this technique.
- Computer Science Implement RSA encryption and decryption functions in Java. Note you should not use any existing security modules to perform the encryption/decryption tasks. Just write a program to compute the answers. Your program should ask user’s input for a public key (n, e), and for Q1 ask for m and display c; and ask for c and display private key d and original message m.Suppose, you are the owner of a bank that operates in a strange way. Customers can lend money from your bank (just like a normal bank) and they can also deposit money in your bank. A register is maintained to track the daily transactions. However, being the strange owner of a strange bank, you have a fascination with finding out whether a portion of your daily transactions (in/out) balance out to zero. For example, suppose your daily transaction register looks like this: 1 Lend 100 2 Deposit 150 3 Lend 400 4 Lend 500 5 Deposit 1000 6 Lend 460 7 Deposit 160 8 Deposit 200 9 Lend 500 10 Depost 100 In this case, there is a portion of the transactions that would balance itself out. (6th, 7th, 8th, and 10th transactions would amount to 0). Your task is to use a genetic algorithm to solve this strange bank problem. Task Breakdown: Model the transaction register in a way suitable for the problem.…C programming Implement an encoder. When completed, your program should be able to accept a short sentence from the user and display an encrypted version of it. For simplicity, let us assume one case of letters throughout, say CAPITALS. We can use a substitution method to scramble a sentence and then use the reverse of this process to recover it. If we take two rows of the alphabet and shift the bottom row along a specified amount (our key), we can then read the letters in our sentence from the top row and use the substituted letter from the bottom row to form the encrypted sentence. A B C D E F G H I J K L M N O P Q R S T U V W X Y Z X Y Z A B C D E F G H I J K L M N O P Q R S T U V W In the example above, the key is 3, hence the second row is shifted by three characters along. Take, for instance, the sentence “HELLO”. Each letter of your message should be replaced by the letter in the alphabet that comes three letters before. For “HELLO” that would be: EBIIL Your program is required…
- Translate the following specifications into English where F(p) is“Printer p is outof service”, B(p) is “Printer p is busy”, L(j) is “Print job j is lost”, and Q(j) is “Print job j isqueued”. a) ∃p(F(p) ∧ B(p)) → ∃jL(j)b) ∀pB(p) → ∃jQ(j)c) ∃j(Q(j) ∧ L(j)) → ∃pF(p)d) (∀pB(p) ∧ ∀jQ(j)) → ∃jL(j)Our discussion of slices in this chapter has actually been about "backward slices" in the sense that we are always concerned with parts of a program that contribute to the value of a variable at a certain point in the program. We could also consider "forward slices" that refer to parts of the program where the variable is used. Compare and contrast forward slices with du-paths.Consider the software that runs in an Automated Teller Machine (ATM) machine. One task that must be able to be performed is to determine the type (denomination) of currency and the numbers of bills (aka “banknotes” for those of you not from North America) for each type dispensed. A requirement is that our ATM use the fewest number of bills that it can to dispense the specified amount of money. It only dispenses fifties, twenties, tens, fives, and ones. Design and implement program that writes out what bills would be dispensed if this machine existed for the amount of money that was asked for by the user.Test CasesIn the comments at the top of your file, list 3 test cases that you came up with. Something like this but choose your own examples. You should write your test cases in such a way that, if they all pass, you can be fairly confident your program will work all the time. '''Test case #1:Input: $1Output: 0 fifties, 0 twenties, 0 tens, 0 fives, 1 onesTest case #2:Input: $22Output:…