What computations would reflect this behavior

Assignment Help Basic Computer Science
Reference no: EM13982079

1. consider the following program:
process P
var
sent=0;
*[true -->
send message(s) to Q,

sent=sent+1]

process Q
var
rcvd=0;
*[
message in channel from P -->
receive message(r) from P,
sent:=sent+1 ]]
rcvd:=r

]

a) Assume that it is coded on a real distributed architecture where the latency of message transmission between processes of P and Q is high (messages take very long to propagate).

What computations would reflect this behavior? Give examples. Explain.

b) Assume that the channel is fast but process Q is significantly slower than P. What computation would reflect this behavior? Give examples. Explain.

c) Assume that process P, Q have about the same speed in the target architecture, however, P seldom has any messages to send to Q. What computation would be appropriate for this behavior? Give examples. Explain.

2. Assume that a distributed program is written in a program-counter sequence of statements of the form assign initial values to variables;
statement1; statement2; statement3; statement4;
...
based notation. That is, it has a
Assuming that the atomicity of the program is the statement, construct an equivalent guarded- command based program. In this the equivalence means the program generates the same set of computations.

3. Convert Tarry's traversal algorithm (see our class slides on Traversals) into guarded command notation, discuss why your guarded-command based program is equivalent.

4. Assume the following modification for the Ring algorithm (See class slides on Waves)
proc initiator const
Next, Prev (* next and previous neighbor *) var
boolean started=false, gotone=false
*[

not started -->
started:=true

send <tok> to Next send <tok> to Prev
[]

receive <tok> from Next or Prev -->
if gotone then decide
else gotone:=true
]
proc non-initiator const
Next, Prev *[
receive <tok> from Prev --> send <tok> to Next
[]

receive <tok> from Next -->
send <tok> to Prev ]

a) formally prove or disprove that this is a wave algorithm

b) for a particular ring size of N processes count the number of non-equivalent computations c) compute the time and message complexity of the algorithm

5. Consider the following modification of the ring algorithm
proc initiator const
Next, Prev (* next and previous neighbor *) var
boolean started=false,
*[

not started -->
started:=true

send <tok> to Next send <tok> to Prev
]
proc all processes (including initiator) const
Next, Prev *[
receive <tok> from Prev --> send <tok> to Next
[]

receive <tok> from Next -->
send <tok> to Prev ]

Does this algorithm have computations that are not weakly fair? If your answer is negative, prove it; if positive: show a weakly unfair computation. Do not worry about the lack of "decide" event at the initiator: it is made to simplify the code; the answer does not depend on it.

6. Prove (provide convincing argument) or disprove (provide a counter-example) that every computation of any wave algorithm is weakly fair.

7. Will the tree algorithm (see class slides on Waves) work on non-tree networks? That is, there are no modifications to the algorithm but the topology of the network is not a tree. Explain your answer.
For the following topology:
ab \/ c /\
de

List a pair of computations that are not equivalent and explain why they are not equivalent.

8. Assuming that "a" is the initiator, list all possible spanning trees that can be formed for the following topology:

a----b |\ | |\| |\| | \| c----d
Show which ones can be produced by:

a) Tarry's algorithm b) Classical algorithm

9. Auerbach's algorithm is a modification of the classical depth-first traversal algorithm. The major change is that two new types of messages are introduced: <vis> and <ack> and the update rules for "used" array are modified. As a consequence of that it becomes necessary to explicitly require that only the initiator decides (notice that in Tarry's and Classical traversal algorithm it is done implicitly -- the only process that can possibly decide is the initiator). Explain why it is necessary and give an example where the Auerbach's algorithm without this particular modification fails.

10. In Auerbach's algorithm. When a process P receives <tok> message it first sends <vis> message to every neighbor, waits for <ack> from every neighbor and then proceeds to forward <tok>.
Would the algorithm be correct if a process does not wait for <ack>s to come back but forwards <tok> immediately after <vis> messages are sent? If yes, explain why; if no, explain why and provide a counter-example

Reference no: EM13982079

Questions Cloud

Write a paper on terrorism : Write a 1-2 page paper on terrorism as a threat to people and infrastructure and how individuals in private and public security can contribute to the prevention of terrorism and terrorist acts within the United States
Illustrating how killing bin laden has affected al qaeda : Determine whether you think the killing of Bin Laden has lowered or raised the fear of terrorism in most U.S. citizens. Give two (2) examples illustrating how killing Bin Laden has affected al Qaeda
Gains from comparative advantage and trade exchange rates : Australia and the United States produce white and red wins. current domestic prices for each prices for each wine are given in the following table: define and identify instances of absolute and comparative advantage. Gains from comparative advantage ..
Discuss junk foods and their relationship to activity : Discuss the relationships between aging, activity and metabolism, referencing the labs on metabolism and aging. Discuss junk foods and their relationship to activity
What computations would reflect this behavior : Assume that the channel is fast but process Q is significantly slower than P. What computation would reflect this behavior? Give examples. Explain.
Fgure out how a decrease in taxes shifts the is curve : According to the graphical method used in class, ?gure out how a decrease in taxes (T) shifts the IS curve. Is this policy an expansionary ?scal policy or a contractionary ?scal policy? Why?[Hint: Use the Keynesian Cross]
Find the answer through binomial distribution : The probability to get 3 times of "5" in 8 throws of a fair die is ? Using Binomial Distribution, and Using Matlab to simulate it.
Draw a diagram respresnting the intial physical situation : Draw and label a diagram respresnting the intial physical situation. Determine the distance from the traffic light that the driver is at the instant that the brakes are applied.
Expansionary fiscal policy or contractionary fiscal policy : According to the graphical method used in class, figure out how a decrease in government purchases (G) is going to affect the IS curve. Is decrease in government purchases an expansionary fiscal policy or a contractionary fiscal policy? Why?[Hint: Us..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write a statement that assigns true to recalled

A bool variable named recalled has been declared. Given an int variable modelYear write a statement that assigns true to recalled if the value of modelYear falls within the recall range and assigns false otherwise. Do not use an if statement in th..

  Explaining options to begin troubleshooting

Which two options should you use to begin troubleshooting?

  Consider the time slot relation

Consider the time slot relation. Given that a particular time slot can meet more than once in a week, explain why day and start time are part of the primary key of this relation, while end time is not.

  Methods of user-based and user-controlled navigation

Discuss different methods of user-based and user-controlled navigation. Define five common types of links used in a navigation system.

  Sra in 2006 a small business was created in the financial

in 2006 a small business was created in the financial sector. the main purpose of the business was to provide customers

  The cost of having the tree removedwould

Suppose that your neighbor owns an old tree, with branches that extend over yourlawn. He enjoys having the tree, getting utility of $100, and incurring $65 ofcleanup costs on his own lawn. However, the tree drops leaves and crabapples onyour lawn, wh..

  Display all the records in emp table

Display the employee's names with first letter capitalized and all other letters lowercase for all employees whose name starts with J,A, or M

  What are techniques to use in planning presentation

You prepared and distributed a system requirements document, and you anticipate some intense questioning at the meeting. When planning your presentation, what are some techniques you will use?

  Find the solution to each of these recurrence

Find the solution to each of these recurrence relations with the given intial conditions. Use an iterative approach.

  A robot

Mobile Robotics Kinematics

  Computing exact speed of a t1 line

Below what speed are there different leased line standards in different parts of the world? What is the exact speed of a T1 line?

  System development methodologies in information systems

There are literally thousands of system development methodologies in the Information Systems field. Suggest some reasons why there might be so many.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd