You are on page 1of 30

See Full Question And Answer at solutionrank.

com

Consider the problem of separating N data points into positive and negative examples using a
linear separator. Clearly, this can always be done for N = 2 points on a line of dimension d = 1,
regardless of how the points are labelled or where they are located (unless the points are in the
same place). a. Show that it ca

Let X, Y, Z be Boolean random variables. Label the eight entries in the joint distribution P (X.
Y, Z) as a through h. Express the statement that X and Y are conditionally independent given Z
as a set of equations relating a through h. How many non-redundant equations are there?

Construct a support vector machine that computes the XOR function. It will be convenient to use
values of 1 and —1 instead of I and 0 for the inputs and for the outputs. So an example looks
like ([—1. ii, 1) or ([—1, —1], —1). It is typical to map an input x into a space consisting of
five dimensions, the two

Show, by translating into conjunctive normal form and applying resolution, that the conclusion
drawn concerning Brazilians is sound.

In this exercise we will consider two-player MDPs that correspond to zero-sum, turn- taking
games like those in Chapter 6. Let the players he A and B, and let R (s) be the reward for player
A in s. (The reward for B is always equal and opposite.) a. Let UA (s) be the utility of state s
when it is A’s turn to move in

See Full Question And Answer at solutionrank.com

Text categorization is the task of assigning a given document to one of a fixed set of categories,
on the basis of the text it contains. Naive Bayes models are often used for this task in these
models, the query variable is the document category, and the ‘effect” variables are the
presence or absence of each word i

Fill in the missing values for the clauses C1 or C2 (or both) in the following sets of clauses,
given that C is the re solvent of C1 and C2: a. C = True → P (A, B), C1 = P (x, y) → Q(x, y),
C2 =?? b. C = True → P (A, B), C1 = ?? C2 =??. c. C = P(x, y) → P(x, f(y)), C1 = ?? C2 =??. If
there is more than one

This exercise completes the analysis of the airport-sitting problem in Figure. a. Provide
reasonable variable domains, probabilities, and utilities for the network, assuming that there are
three possible sites. b. Solve the decision problem. c. What happens if changes in technology
mean that each aircraft generates hal

The network in Figure has four hidden nodes. This number was chosen somewhat arbitrarily.
Run systematic experiments to measure the learning curves for networks with different numbers
of hidden nodes. What is the optimal number? Would it be possible to use a cross-validation
method to find the best network before thefa

Explain how to apply the boosting method naive Bayes learning. Test the performance of the
resulting algorithm on the restaurant learning problem.

See Full Question And Answer at solutionrank.com

For either of the airport-sitting diagrams from Exercises 16.8 and 16.9, to which conditional
probability table entry is the utility most sensitive, given the availableevidence?

Consider the family of linear Gaussian networks, as illustrated. a. In a two-variable network, let
X1 he the parent of X2, let X1 have a Gaussian prior, and let P (X2, X1) be a linear Gaussian
distribution. Show that the joint distribution P(X1, X2) is a multivariate Gaussian, and calculate
its covariance matrix. b. Pr

In the recursive construction of decision trees, it sometimes happens that a mixed set of positive
and negative examples remains at a leaf node, even after all the attributes have been used.
Suppose that we have p positive examples and r negative examples. a. Show that the solution
used by DECISION-TREE-LEARNING, which

In this exercise, you will complete the normalization calculation for the meningitis example.
First, make up a suitable value for P(S —M), and use it to calculate un-normalized values for P
(M│S) and P (—’M│S) (i.e., ignoring the P (S) term in the Bayes’ rule expression).
Now normalize these values so that

A good straw man” learning algorithm is as follows: create a table Out of all the training
examples identify which output occurs most often among the training examples; call it d. Then
when given an input that is not in the table, just return d. For inputs that are in the table, return
the output associated with it (

See Full Question And Answer at solutionrank.com

Suppose that Ann’s utilities for cherry and lime candies are c A and l A, whereas Bob’s
utilities are c B and l B. (But once Ann has un-wrapped a piece of candy. Bob won’t buy it.)
Presumably, if Bob likes lime candies much more than Ann, it would be wise to sell for Ann to
sell her bag of candies once she is suf

Consider the network for car diagnosis shown in Figure. a. Extend the network with the Boolean
variables Icy Weather and Starter Motor. b. Give reasonable conditional probability tables for all
the nodes. c. How many independent values are contained in the joint probability distribution for
eight Boolean nodes, assumin

Two statisticians go to the doctor and are both given the same prognosis: A 40% chance that the
problem is the deadly disease A. and a 60% chance of the fatal disease B. Fortunately, there are
anti-A and anti-B drugs that are inexpensive, 100% effective, and free of side-effects. The
statisticians have the choice of ta

Suppose one writes a logic program that carries out a resolution inference step. That is, let
Resolve (c1, c2, c) succeed if c is the result of resolving cl and c2. Normally Resolve would be
used as part of a theorem prover by calling it with c1 and c2 instantiated to particular clauses,
thereby generating the re-solve

Starting from Equation (20.13), show that δ I, / δ W j = Err x a j.

See Full Question And Answer at solutionrank.com

Assess your own utility for different incremental amounts of money by running a series of
preference tests between some definite amount M1 and a lottery [p, M2; (1—p), 0]. Choose
different values of M1 and M2 vary p until you are in different between the two choices. Plot the
resulting utility function.

Construct by hand a neural network that computes the XOR function of two inputs. Make sure to
specify what sort of units you are using.

Often, we wish to monitor a Continuous-state system whose behavior switches unpredictably


among a set of k distinct “modes.” For example, an aircraft trying to evade a missile can
execute a series of distinct maneuvers that the missile may attempt to track. A Bayesian network
representation of such a switching Kalm

A simple perceptron cannot represent XOR (or, generally, the parity function of its inputs).
Describe what happens to the weights of a four-input, step-function perceptron, and beginning
with all weights set to 0.1, as examples of the parity function arrive.

Suppose that we define the utility of a state sequence to be the maximum reward obtained in any
state in the sequence. Show that this utility function does not result in stationary preferences
between state sequences. Is it still possible to define a utility function on states such that MEU
decision making gives optima

See Full Question And Answer at solutionrank.com

This exercise concerns the expressiveness of decision lists (Section 18.5). a. Show that decision
lists can represent any Boolean function, if the size of the tests is not limited. b. Show that if the
tests can contain at most k literals each, then decision lists can represent any function that can be
represented by a

Investigate the complexity of exact inference in general Bayesian networks: a. Prove that any 3-
SAT problem can be reduced to exact inference in a Bayesian network constructed to represent
the particular problem and hence that exact inference is NP- hard. b. The problem of counting the
number of satisfying assignments
Show that the statement P (A, B│C) = P (A│C) P (D│C) is equivalent to either of the
statements P (A│B, C) = P (A│C) and P (B│A, C) = P (B│C).

Suppose that FOIL is considering adding a literal to a clause using a binary predicate P and those
previous literals (including the head of the clause) contain five different variables. a. How many
functionally different literals can be generated? Two literals are functionally identical if they
differ only in the names

Solve the game of three-finger Morra.

See Full Question And Answer at solutionrank.com

The following payoff matrix, from Blinder (l983) by way of Bernstein (1996), shows a game
between politicians and the Federal Reserve. Politicians can expand or contract fiscal policy,
while the Fed can expand or contract monetary policy. (And of course either side can choose to
do nothing.) Each side also has preferen

Prove that the value of information is nonnegative and order-independent, as stated in Section
16.6. Explain how it is that one can make a worse decision after receiving information than one
would have made before receiving it.

(Adapted from Pearl (1988)) Three prisoners, A, B, and C, are locked in their cells. It is common
knowledge that one of them will be executed the next day and the others pardoned. Only the
governor knows which one will be executed. Prisoner A asks the guard a favor. “Please ask
the governor who will be executed, and

(Adapted from Pearl (1988)) A used-car buyer can decide to carry out various tests with various
costs (e.g., kick the tires, take the car to a qualified mechanic) and then, depending on the
outcome of the tests, decide which car to buy. We will assume that the buyer is deciding whether
to buy car c, that there is time

Consider the query P (Rain│Sprinkler = true, Wet-Grass = true) in Figure (a) and how MCMC
can answer it. a. How many states does the Markov chain have? b. Calculate the transition matrix
Q containing q (y → y’) for all y. y’. c. What does Q2, the square of the transition
matrix, represent? d. What about Q n

See Full Question And Answer at solutionrank.com

Sometimes MDPs are formulated with a reward function R(s, a) that depends on the action taken
or a reward function R (s, a, s’) that also depends on the outcome state. a. Write the Bellman
equations for these formulations. b. Show how an MDP with reward function R (s. a. s’) can
be transformed into a different MDP

Repeat Exercise 16.8, using the action-utility representation shown inFigure.


Suppose that a learning algorithm is trying to find a consistent hypothesis when the
classifications of examples are actually random. There are u Boolean attributes, and examples
are drawn uniformly from the set of 2n possible examples. Calculate the number of examples
required before the probability of finding a contr

Consider the following set of examples, each with six inputs and one target output: a. Run the
perception learning rule on these data and show the final weights. b. Run the decision tree
learning rule, and show the resulting decision tree. c. Comment on yourresults.

Write a computer program to automate the process in Exercise 16.4. Try your program out on
several people of different net worth and political outlook. Comment on the consistency of your
results, both for an individual and across individuals.

See Full Question And Answer at solutionrank.com

Consider the noisy-OR model for fever described in Section 14.3. Explain how to apply
maximum-likelihood learning to fit the parameters of such a model to a set of complete data.

Consider an undiscounted MDP having three states, (1, 2, 3), with rewards —1, —2, 0
respectively. State 3 is a terminal stale. In states I and 2 there are two possible actions: a and b.
The transition model is as follows: • In state 1, action a moves the agent to state 2 with
probability 0.8 and makes the agent s

Show that any second-order Markov process can be rewritten as a first-order Markov process
with an augmented set of state variables. Can this always he done parsimoniously that is, without
increasing the number of parameters needed to specify the transition model?

The model of “tomato” in Figure allows for a coarticulation on the first vowel by giving
two possible phones. An alternative approach is to use a tri-phone model in which the [ow (t, m)]
phone automatically includes the change in vowel sound. Draw a complete tri-phone model for
“tomato,” including the dialect v

The direct utility estimation method in Section 21.2 uses distinguished terminal states to indicate
the end of a trial. How could it be modified for environments with discounted rewards and no
terminal states?

See Full Question And Answer at solutionrank.com

Complete the missing step in the derivation of Equation (15.17), the first update step for the one-
dimensional Kalman filter.

Recall from that there are 22n distinct Boolean functions of n inputs. How many of these are
representable by a threshold perceptron?
Tickets to a lottery cost $1. There are two possible prizes: a $10 payoff with probability 1/50,
and a $1,000,000 payoff with probability 1/2,000,000. What is the expected monetary value of a
lottery ticket? When (if ever) is it rational to buy a ticket? Be precise—show an equation
involving utilities. You may assume

Starting with the passive ADP agent modify it to use an approximate ADP algorithm us
discussed in the text. Do this in two steps: a. Implement a priority queue for adjustments to the
utility estimates. Whenever a state is adjusted, all of its predecessors also become candidates for
adjustment and should be added to the

Would a probabilistic version of determinations be useful? Suggest a definition.

See Full Question And Answer at solutionrank.com

Suppose we generate a training set from a decision tree and then apply decision-tree learning to
that training set. Is it the case that the learning algorithm will eventually return the correct tree as
the training set size goes to infinity? Why or why not’?

Can any finite search problem be translated exactly into a Markov decision problem such that an
optimal solution of the latter is also an optimal solution of the former? If so, explain precisely
how to translate the problem and how to translate the solution back; if not, explain precisely why
not (i.e.., give a counter

In 1738, J. Bernoulli investigated the St. Petersburg paradox, which works as follows. You have
the opportunity to play a game in which a fair coin is tossed repeatedly until it conies up heads. If
the first heads appears on the n.th toss, you win 2n dollars. a. Show that the expected monetary
value of this game is inf

e. What is the most likely number of stars, given these observations? Explain how to compute
this, or, if it is not possible to compute, explain what additional information is needed and how it
would affect theresult.

Calculate the most probable path through the HMM in Figure for the output sequence [C1, C2,
C3, C4, C4, C6, and C 7]. Also give itsprohahi1ity

See Full Question And Answer at solutionrank.com

Write out a general algorithm for answering queries of the form P (Cause│e), using a naive
Bayes distribution. You should assume that the evidence e may assign values to any subset of the
effect variables.

This exercise is concerned with the variable elimination algorithm in Figure. a. Section 14.4
applies variable elimination t the query P (Burglary│JohnCalls = true, Mary Calls = true).
Perform the calculations indicated and check the answer is correct. b. Count the number of
arithmetic operations performed, and com
Consider applying the variable elimination algorithm to the umbrella DBN unrolled for three
slices, where the query is P( R3│U1,U2,U3), Show that the complexity of the algorithm—the
size of the largest factor—is the same, regardless of whether the rain variables are eliminated in
forward or backward order.

This exercise investigates properties of the Beta distribution defined in Equation (20.6). a. Dy
integrating over the range [0, 1], show that the normalization constant for the distribution beta [a,
b] is given by α = Г (x + 1) = Г (a + b)/ Г (a) Г (b) where Г (x) is the Gamma function,
defined by Г (x + 1) = x

Consider an arbitrary Bayesian network, a complete data set for that network, and the likelihood
for the data set according to the network. Give a simple proof that the likelihood of the data
cannot decrease if we add a new link to the network and re-compute the maximum likelihood
parameter values.

See Full Question And Answer at solutionrank.com

Consider the problem faced by an infant learning to speak and understand a language. Explain
how this process fits into the general learning model, identifying each of the components of the
model as appropriate.

Consider the application of EM to learn the parameters for the network in Figure (a), given the
true parameters in Equation (20.7). a. Explain why the EM algorithm would not work if there
were just two attributes in the model rather than three. b. Show the calculations for the first
iteration of EM starting from Equati

Consider the relational database of Figure, where the primary keys are underlined. Give an
expression in the relational algebra to express each of the following queries: a. Find the names of
all employees who work for First Bank Corporation. b. Find the names and cities of residence of
all employees who work for First

Consider the algorithm in figure to compute α+. Show that this algorithm is more efficient than
the one presented in Figure (Section 7.3.3) and that it computes α+ correctly.

Consider the employee database of Figure. Give expressions in QBE, and Datalog for each of the
following queries: a. Find the names of all employees who work for First Bank Corporation. b.
Find the names and cities of residence of all employees who work for First Bank Corporation. c.
Find the names, street addresses, a

See Full Question And Answer at solutionrank.com

Write an assertion for the bank database to ensure that the assets value for the Perryridge branch
is equal to the sum of all the amounts lent by the Perryridge branch.
This exercise investigates the way in which conditional independence relationships affect the
amount of information needed for probabilistic calculations. a. Suppose we wish to calculate P
(h│e1, e2) and we have no conditional independence information. Which of the following sets
of numbers are sufficient for the ca

Referential-integrity constraints as defined in this chapter involve exactly two relations. Consider
a database that includes the following relations: salaried-worker (name, office, phone, salary)
hourly-worker (name, hourly-wage) address (name, street, city) Suppose that we wish to require
that every name that appears

Consider the following relational database: employee (employee-name, street, and city) works
(employee name, company-name, salary) company (company-name, city) manages (employee-
name, manager name) Give an SQL DDL definition of this database. Identify referential-
integrity constraints that should hold, and include them

Let R = (A, B) and S = (A, C), and let r(R) and s(S) be relations. Write relational-algebra
expressions equivalent to the following domain-relationalcalculus expressions: a. {< a > | ∃ b
(< a, b >∈ r ∧ b = 17)} b. {< a, b, c > | < a, b >∈ r ∧ < a, c >∈ s} c. {< a > | ∃ b (< a, b
>∈ r) ∨ ∀c (∃ d

See Full Question And Answer at solutionrank.com

Describe how an arbitrary Data log rule can be expressed as an extended relational algebra view.

a. Display the grade for each student, based on the marks relation. b. Find the number of students
with each grade.

Consider the relation of as shown below, which shows the result of the query “Find the names
of all customers who have a loan at the bank.” Rewrite the query to include not only the name,
but also the city of residence for each customer. Observe that now customer Jackson no longer
appears in the result, even though

When designing an E-R diagram for a particular enterprise, you have several alternatives from
which to choose. a. What criteria should you consider in making the appropriate choice? b.
Design three alternative E-R diagrams to represent the university registrar’s office of
Exercise 2.4. List the merits of each. Argue

Perhaps the most important data items in any database system are the passwords that control
access to the database. Suggest a scheme for the secure storage of passwords.Be sure that your
scheme allows the systemto test passwords supplied by users who are attempting to log into the
system.

See Full Question And Answer at solutionrank.com


Consider the relational database of Figure where the primary keys are underlined. Give
expressions in QBE for each of the following queries: a. Find all employees who earn more than
the average salary of all employees of their company. b. Find the company that has the most
employees. c. Find the company that has the sm

Give an SQL schema definition for the employee database of Figure. Choose an appropriate
domain for each attribute and an appropriate primary key for each relationschema.

Consider two separate banks that decide to merge. Assume that both banks use exactly the same
E-R database schema—the one in Figure below (This assumption is of course highly unrealistic;
we consider the more realistic case in Section 19.8.) If the merged bank is to have a single
database, there are several potential

Consider the insurance database of Figure, where the primary keys are underlined. Construct the
following QBE queries for this relational-database. a. Find the total number of people who
owned cars that were involved in accidents in 1989. b. Find the number of accidents in which the
cars belonging to “John Smith” w

Design a relational database corresponding to the E-R diagram ofFigure.

See Full Question And Answer at solutionrank.com

Suppose there are two relations r and s, such that the foreign key B of r references the primary
key A of s. Describe how the trigger mechanism can be used to implement the on delete cascade
option, when a tuple is deleted from s.

SQL-92 provides an n-ary operation called coalesce, which is defined as follows: coalesce
(A1,A2, . . . , An) returns the first nonnull Ai in the list A1,A2, . . .,An, and returns null if all of
A1,A2, . . .,An are null. Show how to express the coalesce operation using the case operation.

In Section 2.4.3, we represented a ternary relationship (Figure a) using binary relationships, as


shown in (Figure b). Consider the alternative shown in (Figure c). Discuss the relativemerits of
these two alternative representations of a ternary relationship by binary relationships.

List all functional dependencies satisfied by the relation of Figure.

Give a loss less-join decomposition into BCNF of schema R of Exercise 7.2.

See Full Question And Answer at solutionrank.com

Use Armstrong’s axioms to prove the soundness of the pseudotransitivity rule.

What is the purpose of having separate categories for index authorization and resource
authorization?
Figure shows a lattice structure of generalization and specialization. For entity sets A, B, and C,
explains how attributes are inherited from the higherlevel entity sets X and Y. Discuss how to
handle a case where an attribute of X has the same name as some attribute of Y.

Consider the relational database of Figure. Give expressions in QBE for each of the following
queries: a. Modify the database so that Jones now lives in Newtown. b. Give all employees of
First Bank Corporation a 10 percent raise. c. Give all managers in the database a 10 percent raise.
d. Give allmanagers in the databa

Let R = (A, B, C), and let r1 and r2 both be relations on schema R. Give expressions in QBE, and
Datalog equivalent to each of the following queries: a. r1 ∪ r2 b. r1 ∩ r2 c. r1 − r2 d. IIAB
(r1) 1 IIBC (r2)

See Full Question And Answer at solutionrank.com

Consider the relational database of Figure. Give a relational-algebra expression for each of the
following queries: a. Find the company with the most employees. b. Find the company with the
smallest payroll. c. Find those companies whose employees earn a higher salary, on average,
than the average salary at First BankC

Consider the SQL query select p.a1 from p, r1, r2 where p.a1 = r1.a1 or p.a1 = r2.a1. Under what
conditions does the preceding query select values of p.a1 that are either in r1 or in r2? Examine
carefully the cases where one of r1 or r2 may be empty.

Let a prime attribute be one that appears in at least one candidate key. Let α and β be sets of
attributes such that α → β holds but β → α do not hold. Let A be an attribute that is not in α,
is not in β, and for which β → A holds. We say that A is transitively dependent on α. We can
restate our definit

Consider the representation of a ternary relationship using binary relationships as described in


Section 2.4.3 (shown in Figure b) a. Show a simple instance of E, A, B, C, RA, RB, and RC that
cannot correspond to any instance of A, B, C, and R. b. Modify the E-R diagram of Figure b to
introduce constraints that will gu

Certain systems allow marked nulls. A marked null ⊥i is equal to itself, but if i ≠j, then
⊥i ≠⊥j. One application of marked nulls is to allow certain updates through views.
Consider the view loan-info (Section 3.5). Show how you can use marked nulls to allow the
insertion of the tuple (“Johnson”, 1900)

See Full Question And Answer at solutionrank.com

Let the following relation schemas be given: R = (A, B, C) S = (D, E, F) Let relations r(R) and
s(S) be given. Give an expression in SQL that is equivalent to each of the following queries. a.
п A(r) b. σB = 17 (r) c. r × s d. IIA, F (σC =D(r × s))
The outer-join operations extend the natural-join operation so that tuples from the participating
relations are not lost in the result of the join. Describe how the theta join operation can be
extended so that tuples from the left, right, or both relations are not lost from the result of a theta
join.

Write an SQL trigger to carry out the following action: On delete of an account, for each owner
of the account, check if the owner has any remaining accounts, and if she does not, delete her
from the depositor relation.

In designing a relational database, why might we choose a non-BCNF design?

Write an extended relational-algebra view equivalent to the Datalog rule p (A,C,D) :– q1
(A,B), q2 (B,C), q3 (4,B), D = B + 1 .

See Full Question And Answer at solutionrank.com

Draw the UML equivalents of the E-R diagrams.

Use the definition of functional dependency to argue that each of Armstrong’s axioms
(reflexivity, augmentation, and transitivity) is sound.

Reconsider the situation described for Exercise 2.26 under the assumption that one bank is in the
United States and the other is in Canada. As before, the banks use the schema of Figure, except
that the Canadian bank uses the social-insurance number assigned by the Canadian government,
whereas the U.S. bank uses the so

Consider the relational database of Figure. Give an expression in SQL for each of the following
queries. a. Modify the database so that Jones now lives in Newtown. b. Give all employees of
First Bank Corporation a 10 percent raise. c. Give all managers of First Bank Corporation a 10
percent raise. d. Give all managers

Explain how functional dependencies can be used to indicate the following: • A one-to-one
relationship set exists between entity sets account and customer. • A many-to-one relationship
set exists between entity sets account and customer.

See Full Question And Answer at solutionrank.com

Explain the distinction between total and partial constraints.

Describe the circumstances in which you would choose to use embedded SQL rather than SQL
alone or only a general-purpose programming language.

Consider a view branch-cust defined as follows: create view branch-cust as select branch-name,
customer-name from depositor, account where depositor.account-number = account.account-
number Suppose that the view is materialized, that is, the view is computed and stored. Write
active rules to maintain the view, that is,

Design a relational database for a university registrar’s office. The office maintains data
about each class, including the instructor, the number of students enrolled, and the time and place
of the class meetings. For each student–class pair, a grade is recorded.

Write an SQL query, without using a with clause, to find all branches where the total account
deposit is less than the average total account deposit at all branches, a. Using a nested query in
the from clauser. b. Using a nested query in a having clause.

See Full Question And Answer at solutionrank.com

An E-R diagram can be viewed as a graph. What do the following mean in terms of the structure
of an enterprise schema? a. The graph is disconnected. b. The graph is acyclic.

Suppose that we decompose the schema R = (A, B, C, D, E) into (A, B, C) (A, D, E). Show that
this decomposition is a loss less-join decomposition if the following set F of functional
dependencies holds: A → BC CD → E B → D E → A

A functional dependency α → β is called a partial dependency if there is a proper subset γ of


α such that γ → β.We says that β is partially dependent on α. A relation schema R is in
second normal form (2NF) if each attributes A in R meets one of the following criteria: • It
appears in a candidate key.

List two reasons why we may choose to define a view.

Let R = (A, B) and S = (A, C), and let r(R) and s(S) be relations.Write expressions in QBE and
Datalog for each of the following queries: a. {< a > | ∃ b (< a, b >∈ r ∧ b = 17)} b. {< a, b, c
> | < a, b >∈ r ∧ < a,c >∈ s} c. {< a > | ∃ c (< a,c >∈ s ∧ ∃b1, b2 (< a,b1 > ∈ r ∧ <
c, b2 > ∈ r â

See Full Question And Answer at solutionrank.com

Use Armstrong’s axioms to prove the soundness of the union rule

Let R1, R2, Rn be a decomposition of schema U. Let u (U) be a relation, and let r i = IIRI (a).
Show that u ⊆ r1 1 r2 1 • • • 1 rn

Let a and b be relations with the schemas A (name, address, title) and B(name, address, salary),
respectively. Show how to express a natural full outer join b using the full outer join operation
with an on condition and the coalesce operation. Make sure that the result relation does not
contain two copies of the attrib
Complete the SQL DDL definition of the bank database of Figure to include the relations loan
andborrower.

In Chapter we saw how to represent many-to-many, many-to-one, one-tomany, and one-to-one


relationship sets. Explain how primary keys help us to represent such relationship sets in the
relational model.

See Full Question And Answer at solutionrank.com

Using the relations of our sample bank database, write an SQL expression to define the following
views: a. A view containing the account numbers and customer names (but not the balances) for
all accounts at the Deer Park branch. b. A view containing the names and addresses of all
customers who have an account with the

Why certain functional dependencies are called trivial functional dependencies?

List two major problems with processing update operations expressed in terms of views.

Show that it is possible to ensure that a dependency-preserving decomposition into 3NF is a loss
less-join decomposition by guaranteeing that at least one schema contains a candidate key for the
schema being decomposed.

Let R = (A, B, C), and let r1 and r2 both be relations on schema R. Give an expression in SQL
that is equivalent to each of the following queries. a. r1 ∪ r2 b. r1 ∩ r2 c. r1 − r2 d. II AB(r1)
1 Î BC(r2)

See Full Question And Answer at solutionrank.com

Explain the distinction between condition-defined and user-defined constraints. Which of these
constraints can the system check automatically? Explain your answer.

Consider the relational database of Figure. Using SQL, define a view consisting of manager-
name and the average salary of all employees who work for that manager. Explain why the
database system should not allow updates to be expressed in terms of this view.

Let R = (A, B) and S = (A, C), and let r(R) and s(S) be relations. Using the special constant null,
write tuple-relational-calculus expressions equivalent to each of the following: a. r 1 s b. r 1 s c. r
1s

Explain the distinction between disjoint and overlapping constraints.

Explain what is meant by repetition of information and inability to represent information.


Explain why each of these properties may indicate a bad relationaldatabase design.

See Full Question And Answer at solutionrank.com


Consider the following proposed rule for functional dependencies: If α → β and γ → β, then
α → γ. Prove that this rule is not sound by showing a relation r that satisfies α → β and γ →
β, but does not satisfy α → γ.

Database systems that store each relation in a separate operating-system file may use the
operating system’s security and authorization scheme, instead of defining a special scheme
themselves. Discuss an advantage and a disadvantage of such an approach.

Using the functional dependencies of Exercise 7.11, compute the canonical cover Fc.

Make a list of security concerns for a bank. For each item on your list, state whether this concern
relates to physical security, human security, operatingsystem security, or database security.

Use Armstrong’s axioms to prove the soundness of the decomposition rule.

See Full Question And Answer at solutionrank.com

In Chapter 3, we described the use of views to simplify access to the database by users who need
to see only part of the database. In this chapter, we described the use of views as a
securitymechanism. Do these two purposes for views ever conflict? Explain your answer.

A weak entity set can always be made into a strong entity set by adding to its attributes the
primary key attributes of its identifying entity set. Outline what sort of redundancy will result if
we do so.

Design a generalization–specialization hierarchy for a motor-vehicle sales company. The


company sells motorcycles, passenger cars, vans, and buses. Justify your placement of attributes
at each level of the hierarchy. Explain why they should not be placed at a higher or lower level.

Show that, in SQL, < > all is identical to not in.

Repeat Exercise 3.5 using the tuple relational calculus and the domain relational calculus.

See Full Question And Answer at solutionrank.com

Using the bank example, write relational-algebra queries to find the accounts held by more than
two customers in the following ways: a. Using an aggregate function. b. Without using any
aggregate functions.

SQL allows a foreign-key dependency to refer to the same relation, as in the following example:
create table manager (employee-name char (20), manager-name char(20), primary key
employee-name, foreign key (manager-name) references manager on delete cascade ) Here,
employee-name is a key to the table manager, meaning th

List the three design goals for relational databases, and explain why each is desirable.
Let R = (A, B, C), and let r1 and r2 both be relations on schema R. Give an expression in the
domain relational calculus that is equivalent to each of the following: a. IIA(r1) b. σB =17 (r1)
c. r1 ∪ r2 d. r1 ∩ r2 e. r1 − r2 f. IIA,B(r1) 1 ΠB,C(r2)

Give an example of a relation schema R` and set F` of functional dependencies such that there
are at least three distinct lossless-join decompositions of R` into BCNF.

See Full Question And Answer at solutionrank.com

Let the following relation schemas be given: R = (A, B, C) S = (D, E, F) Let relations r(R)
ands(S) be given. Give expressions in QBE, and Data log equivalent to each of the following
queries: a. IIA(r) b. σB =17 (r) c. r × sd. IIA,F (σC =D(r × s))

Describe the differences inmeaning between the terms relation and relation schema. Illustrate
your answer by referring to your solution to Exercise below. student (student-id, name, program)
course (courseno, title, syllabus, credits) course-offering (courseno, secno, year, semester, time,
room) instructor (instructor-

Consider the employee database of Figure, where the primary keys are underlined. Give an
expression in SQL for each of the following queries. a. Find the names of all employees who
work for First Bank Corporation. b. Find the names and cities of residence of all employees who
work for First Bank Corporation. c. Find th

Given the database schema R (a, b, c), and a relation r on the schema R, write an SQL query to
test whether the functional dependency b → c holds on relation r. Alsowrite an SQL assertion
that enforces the functional dependency. Assume that no null values are present.

For each of the views that you defined in Exercise 6.10, explain how updates would be
performed (if they should be allowed at all).

See Full Question And Answer at solutionrank.com

Write check conditions for the schema you defined in Exercise 4.14 to ensure that: a. Every
employee works for a company located in the same city as the city in which the employee lives.
b. No employee earns a salary higher than that of his manager.

Using the functional dependencies of Exercise 7.11, compute B+.

Consider the relational database of Figure. Give an expression in the relational algebra for each
request: a. Modify the database so that Jones now lives in Newtown. b. Give all employees of
First Bank Corporation a 10 percent salary raise. c. Give all managers in this database a 10
percent salary raise. d. Give allman

Consider the insurance database of Figure, where the primary keys are underlined. Construct the
following SQL queries for this relational database. a. Find the total number of people who owned
cars that were involved in accidents in 1989. b. Find the number of accidents in which the cars
belonging to “John Smith” w

Let the following relation schemas be given: R = (A, B, C) S = (D, E, F) Let relations r(R) and
s(S) be given. Give an expression in the tuple relational calculus that is equivalent to each of the
following: a. II A(τ) b. σB =17 (τ) c. τ × s d. IIA, F (σC =D(τ × s))

See Full Question And Answer at solutionrank.com

Show that the decomposition in exercise is not a dependency-preserving decomposition.

Let R = (A, B) and S = (A, C), and let r(R) and s(S) be relations. Write an expression in SQL for
each of the queries below: a. {< a > | ∃ b (< a, b >∈ r ∧ b = 17)} b. {< a, b, c > | < a, b >∈ r
∧ < a, c >∈ s} c. {< a > | ∃ c (< a, c >∈ s ∧ ∃b1, b2 (< a b1 > ∈ r ∧ < c, b2 > ∈ r ∧
b1 > b2)

Give a lossless-join, dependency-preserving decomposition into 3NF of schema R of Exercise


7.2.

Explain how functional dependencies can be used to indicate the following: • A one-to-one
relationship set exists between entity sets account and customer. • A many-to-one relationship
set exists between entity sets account and customer.

Show that the following decomposition of the schema R of Exercise 7.2 is not loss less-join
decomposition: (A, B, C) (C, D, E).

See Full Question And Answer at solutionrank.com

What are two advantages of encrypting data stored in the database?

List two reasons why null values might be introduced into the database.

What activities go on during the user preparation phase of systems implementation?

What are some tools and techniques for software development?

How can SaaS be used in software acquisition?

See Full Question And Answer at solutionrank.com

What are the advantages and disadvantages of the object oriented approach to systems
implementation?

Consider the relational database of Figure. Write a Datalog program for each of the following
queries: a. Find all employees who work (directly or indirectly) under the manager “Jones”.
b. Find all cities of residence of all employees who work (directly or indirectly) under the
manager “Jones”. c. Find all pair

What is a variant? What dangers are associated with such malware?

You have just begun a new position in customer relations for a mid-sized bank. Within your first
week on the job, several customers have expressed concern about potential theft of customer data
from the bank's computer databases and identity theft. Who would you talk with to develop a
satisfactory response to address y

You are the new head of corporate security for a large Fortune 1000 company and are alarmed at
the number of laptop computers your firm's employees lose each month. What actions would you
take to cut down on the potential for loss of personal and/or company confidential data?

See Full Question And Answer at solutionrank.com

What is a virus? What is a worm? How are they different?

Why are all computer crimes not reported to law enforcement agencies?

Identify specific controls that are used to maintain input integrity and security.

How is system performance measurement related to the systems review?

Briefly discuss the difference between acting morally and acting legally. Give an example of
acting legally and yet immorally.

See Full Question And Answer at solutionrank.com

Describe the participants in the systems design stage. How do these participants compare with
the participants of systems investigation?

Discuss the relationship between maintenance and systems design.

Using information presented in this chapter on federal privacy legislation, identify which federal
law regulates the following areas and situations: cross-checking IRS and Social Security files to
verify the accuracy of information, customer liability for debit cards, your right to access data
contained in federal agen

What is the difference between a patent and a copyright? What copyright issues come into play
when downloading software or music from a Web site?

What are the steps involved in testing the information system?

See Full Question And Answer at solutionrank.com


What does intrusion detection software do? What are some of the issues with the use of this
software?

Assume that you want to start a new video rental business for students at your college or
university. Go through logical design for a new information system to help you keep track of the
videos in your inventory.

What is the difference between the Children's Online Privacy Protection Act and the Children's
Internet Protection Act?

Describe how you would select the best admissions software for your college or university. What
features would be most important for school administrators? What features would be most
important for students?

What issues might you expect to arise if you initiate the use of a request for maintenance form
when none had been required previously? How would you deal with these issues?

See Full Question And Answer at solutionrank.com

What is phishing? What actions can you take to reduce the likelihood that you will be a victim of
this crime?

What is a spam filter? How does such a program work? What is the issue with image-based
spam?

Identify at least five tips to follow to avoid becoming a victim of a computer scam.

What is interactive processing? What design factors should be taken into account for this type of
processing?

Assume that you are the owner of an online stock-trading company. Describe how you could
design the trading system to recover from a disaster.

See Full Question And Answer at solutionrank.com

What is ergonomics? How can it be applied to office workers?

Rogers Communications is one of Canada's largest telecom companies. It offers home phone
services, wireless phone services, Internet service, and cable TV service. Rogers provides small
shops in 93 malls across Canada to service its customers. The stores sell a wide variety of phones
and other telecom devices and servi

You are a senior member of a marketing organization for a manufacturer of children's toys. A
recommendation has been made to develop a Web site to promote and sell your firm's products
as well as learn more about what parents and their children are looking for in new toys. Develop
a list of laws and regulations that wi
Outline a four-step process to prevent computer waste and mistakes.

A project team has estimated the costs associated with the development and maintenance of a
new system. One approach requires a more complete design and will result in a slightly higher
design and implementation cost but a lower maintenance cost over the life of the system. The
second approach cuts the design effort, s

See Full Question And Answer at solutionrank.com

What is environmental design?

Identify some of the advantages and disadvantages of purchasing a database package instead of
taking the DaaS approach.

What specific actions can you take to avoid spyware?

What is an RFP? What is typically included in one? How is it used?

How can the object-oriented approach be used during systems design?

See Full Question And Answer at solutionrank.com

Your 12-year-old niece shows you a dozen or so photos of herself and a brief biography
including address and cell phone number she plans to post on MySpace. What advice might you
offer her about posting personal information and photos?

Assume that you have a personal computer that is several years old. Describe the steps you
would use to perform systems review to determine whether you should acquire a new PC.

What is the difference between logical and physical design?

What is the goal of conducting a systems review? What factors need to be considered during
systems review?

You have been hired to oversee a major systems development effort to purchase a new
accounting software package. Describe what is important to include in the contract with the
software vendor.

See Full Question And Answer at solutionrank.com

Imagine that you are a hacker and have developed a Trojan horse program. What tactics might
you use to get unsuspecting victims to load the program onto their computer?

Northrop Grumman is a global defense and technology company specializing in information


services, electronics, aerospace, and shipbuilding for government and commercial purposes.
Northrop Grumman scientists and engineers place heavy computational demands on their
computer systems. Simulations and computer-aided design

Imagine that your friend regularly downloads copies of newly released, full-length motion
pictures for free from the Internet and makes copies for others for a small fee. Do you think that
this is ethical? Is it legal? Would you express any concerns with him?

Outline an approach, including specific techniques (e.g., dumpster diving, phishing, social
engineering) that you could employ to gain personal data about the members of your class.

Discuss the importance of educating employees in preventing computer waste and computer
crime. Imagine that you are given the assignment of developing a computer education program
for your employer. What topics would you cover in the course?

See Full Question And Answer at solutionrank.com

What are the different types of software and database backup? Describe the procedure you use to
back up your homework files.

Assume that you are starting an Internet site to sell clothing. Describe how you would design the
interactive processing system for this site. Draw a diagram showing the home page for the Web
site. Describe the important features of this home page.

What are some of the reasons for program maintenance? Explain the types of maintenance.

Outline measures you should take to protect yourself against viruses and worms.

Identify the various forms of testing. Why are there so many different types of tests?

See Full Question And Answer at solutionrank.com

Give three examples of an IS vendor.

How can antivirus software reduce computer waste?

1. What function(s) did the systems analysis report and the design report play in the creation of
the AMCI system? 2. What precautions did Josh and Sandra take to make sure the AMCI system
was stable and met customer needs prior to mass production? Critical Thinking Questions 1.
What did Josh and Sandra do that was

Discussion Questions 1. Why do you think extending access to the Whitmann Price network
beyond the business's walls dramatically elevated the risk to information security? 2. What was
the primary tool used to minimize that risk, and how does it work? Critical Thinking Questions
1. Why does information security usua
Assume that your project team has been working for three months to complete the systems
design of a new Web-based customer ordering system. Two possible options seem to meet all
users' needs. The project team must make a final decision on which option to implement. The
following table summarizes some of the key facts a

See Full Question And Answer at solutionrank.com

Do you believe that the National Security Agency should be able to collect the telephone call
records of U.S. citizens without the use of search warrants? Why or why not?

Sometimes in protecting a network, the ones to watch are within the organization. That's the
lesson learned by the City of San Francisco. The city's network administrator for its multimillion
dollar wide area network (WAN) seized control of the network and denied other system
administrators access for ten days while ja

Rewrite the BinaryHeap insert method by placing a reference to the inserted item in position 0.

A complete binary tree of N elements uses array positions 1 to N. Suppose we try to use an array
representation of a binary tree that is not complete. Determine how large the array must be for
the following: a. A binary tree that has two extra levels (that is, it is very slightly unbalanced) b.
A binary tree that has

Using the quicksort implementation in this chapter, determine the running time of quicksort for
a. Sorted input b. Reverse-ordered input c. Random input

See Full Question And Answer at solutionrank.com

Suppose that G = (V, E) is a tree, s is the root, and we add a vertex t and edges of infinite
capacity from all leaves in G to t. Give a linear-time algorithm to find a maximum flow from s to
t.

What is a code of ethics? Give an example.

Prove that the running time of Shellsort, using the increment sequence suggested by Hibbard, is
(N3/2) in the worst case. Hint: You can prove the bound by considering the special case of what
Shellsort does when all elements are either 0 or 1. Set a[i] = 1 if i is expressible as a linear
combination of ht, ht−1, . .

Prove that any algorithm that finds an element X in a sorted list of N elements requires Ω(logN)
comparisons.

Suppose you have an array of N elements containing only two distinct keys, true and false. Give
an O(N) algorithm to rearrange the list so that all false elements precede the true elements. You
may use only constant extra space.
See Full Question And Answer at solutionrank.com

Give an algorithm to find in an undirected (connected) graph a path that goes through every edge
exactly once in each direction.

a. For the quicksort implementation in this chapter, what is the running time when all keys are
equal? b. Suppose we change the partitioning strategy so that neither i nor j stops when an
element with the same key as the pivot is found. What fixes need to be made in the code to
guarantee that quicksort works, and what

Solve the following recurrence:

Give an algorithm that finds the strongly connected components in only one depth-first search.
Use an algorithm similar to the biconnectivity algorithm.

Design an algorithm that generates a maze that contains no path from start to finish but has the
property that the removal of a prespecified wall creates a unique path.

See Full Question And Answer at solutionrank.com

a. Give an algorithm to find an augmenting path that permits the maximum flow. b. Let f be the
amount of flow remaining in the residual graph. Show that the augmenting path produced by the
algorithm in part (a) admits a path of capacity f/|E|. c. Show that after |E| consecutive iterations,
the total flow remaining in

Suppose we want to add an extra operation, deunion, which undoes the last union operation that
has not been already undone. a. Show that if we do union-by-height and finds without path
compression, then deunion is easy and a sequence of M union, find, and deunion operations takes
O(MlogN) time. b. Why does path compr

We are given an array that contains N numbers. We want to determine if there are two numbers
whose sum equals a given number K. For instance, if the input is 8, 4, 1, 6, and K is 10, then the
answer is yes (4 and 6). A number may be used twice. Do the following: a. Give an O(N2)
algorithm to solve this problem. b. Gi

Consider the following algorithm for sorting six numbers: • Sort the first three numbers using
Algorithm A. • Sort the second three numbers using Algorithm B. • Merge the two sorted
groups using Algorithm C. Show that this algorithm is suboptimal, regardless of the choices for
Algorithms A, B, and C.

Give a linear-time algorithm to determine the longest unweighted path in an acyclic undirected
graph (that is, a tree).

See Full Question And Answer at solutionrank.com


Continuing from Exercise 7.25, after part (a), a. Perform a test so that the smaller subarray is
processed by the first recursive call, while the larger subarray is processed by the second
recursive call. b. Remove the tail recursion by writing a while loop and altering left or right, as
necessary. c. Prove that the

a. Prove that the running time of Shellsort is (N2) using increments of the form 1, c, c2, . . . , ci
for any integer c. b. Prove that for these increments, the average running time is Θ(N3/2).

Determine the running time of mergesort for a. Sorted input b. Reverse-ordered input c. Random
input

Prove that in a depth-first spanning forest of a directed graph, all cross edges go from right to
left.

Determine the running time of Shellsort for a. Sorted input b. Reverse-ordered input

See Full Question And Answer at solutionrank.com

How many nodes are in the large heap in Figure 6.13?

Give a polynomial-time algorithm that finds [V/2] vertices that collectively cover at least three-
fourths (3/4) of the edges in an arbitrary undirected graph.

An Euler circuit in a directed graph is a cycle in which every edge is visited exactly once. a.
Prove that a directed graph has an Euler circuit if and only if it is strongly connected and every
vertex has equal indegree and outdegree. b. Give a linear-time algorithm to find an Euler circuit
in a directed graph where

Show that if all of the unions precede the finds, then the disjoint set algorithm with path
compression requires linear time, even if the unions are done arbitrarily.

Show the result of the following sequence of instructions: union(1,2), union(3,4), union(3,5),
union(1,7), union(3,6), union(8,9), union(1,8), union(3,10), union (3,11), union(3,12),
union(3,13), union(14,15), union(16,0), union(14,16), union (1,3), union(1, 14) when the unions
are: a. Performed arbitrarily. b. Perfo

See Full Question And Answer at solutionrank.com

Prove that any comparison-based sorting algorithm requires Ω(N logN) comparisons on
average.

a. Consider the following solution to the Euler circuit problem: Assume that the graph is
biconnected. Perform a depth-first search, taking back edges only as a last resort. If the graph is
not biconnected, apply the algorithm recursively on the biconnected components. Does this
algorithm work? b. Suppose that when ta
Show how to modify the topological sort algorithm so that if the graph is not acyclic, the
algorithm will print out some cycle. You may not use depth-first search.

Prove that for the mazes generated by the algorithm in Section 8.7, the path from the starting to
ending points is unique. α(M,N) = min{i ≥ 1| (A (i, M/N) > logN)}, where A(1, j) =
2j............................................j ≥ 1 A(i, 1) = A(i − 1, 2) .................................i ≥ 2 A(i, j) =
A(i

Which of the two selection algorithms has the better time bound?

See Full Question And Answer at solutionrank.com

Find all the articulation points in the graph in Figure 9.85. Show the depth-first spanning tree and
the values of Num and Low for each vertex.

Suppose we perform a breadth-first search of an undirected graph and build a breadth-first


spanning tree. Show that all edges in the tree are either tree edges or cross edges.

Show that the two smallest elements among N can be found in N + [logN] − 2 comparisons.

Repeat Exercise 7.20 when the pivot is chosen as a. The first element b. The larger of the first
two distinct elements c. A random element d. The average of all elements in the set In exercise
Using the quicksort implementation in this chapter, determine the running time of quicksort for
a. Sorted input b. Reve

Show that the expected depth of the kth smallest element in a large complete heap (you may
assume N = 2k − 1) is bounded by log k.

See Full Question And Answer at solutionrank.com

Suppose we choose the element in the middle position of the array as the pivot. Does this make it
unlikely that quicksort will require quadratic time?

Give an algorithm to find a maximum spanning tree. Is this harder than finding a minimum
spanning tree?

If all the edges in a graph have weights between 1 and |E|, how fast can the minimum spanning
tree be computed?

A multigraph is a graph in which multiple edges are allowed between pairs of vertices. Which of
the algorithms in this chapter work without modification for multigraphs? What modifications
need to be done for the others?

Find a topological ordering for the graph in Figure 9.81.

See Full Question And Answer at solutionrank.com


Sort 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5 using quicksort with median-of-three partitioning and a cutoff of
3.

a. Find a minimum spanning tree for the graph in Figure 9.84 using both Prim's and Kruskal's
algorithms. b. Is this minimum spanning tree unique? Why?

Suppose we want to add an extra operation, remove(x), which removes x from its current set and
places it in its own. Show how to modify the union/find algorithm so that the running time of a
sequence of M union, find, and remove operations is O(Mα(M,N)).

Do either of the following modifications to the Shellsort routine coded in Figure 7.4 affect the
worst-case running time? a. Before line 11, subtract one from gap if it is even. b. Before line 11,
add one to gap if it is even.

How would you implement mergesort without using recursion?

See Full Question And Answer at solutionrank.com

You are given a set of N sticks, which are lying on top of each other in some configuration. Each
stick is specified by its two endpoints; each endpoint is an ordered triple giving its x, y, and z
coordinates; no stick is vertical. A stick may be picked up only if there is no stick on top of it. a.
Explain how to writ

A graph is k-colorable if each vertex can be given one of k colors, and no edge connects
identically colored vertices. Give a linear-time algorithm to test a graph for two-colorability.
Assume graphs are stored in adjacency list format; you must specify any additional data
structures that are needed.

Does either Prim's or Kruskal's algorithm work if there are negative edge weights?

Show that there are inputs that force every percolateDown in heapsort to go all the way to a leaf.

A planar graph is a graph that can be drawn in a plane without any two edges intersecting. a.
Show that neither of the graphs in Figure 9.87 is planar. b. Show that in a planar graph, there
must exist some vertex which is connected to no more than five nodes. c. Show that in a planar
graph, |E| ≤ 3|V| − 6.

See Full Question And Answer at solutionrank.com

a. Prove that for binary heaps, buildHeap does at most 2N−2 comparisons between elements. b.
Show that a heap of eight elements can be constructed in eight comparisons between heap
elements. c. Give an algorithm to build a binary heap in 13/8 N + O(logN) element comparisons.
a. Prove that any comparison-based algorithm to sort 4 elements requires 5 comparisons. b. Give
an algorithm to sort 4 elements in 5 comparisons.

Suppose we implement the median of three routine as follows: Find the median of a[left],
a[center], a[right], and swap it with a[right]. Proceed with the normal partitioning step starting i
at left and j at right-1 (instead of left+1 and right-2). a. Suppose the input is 2, 3, 4, . . . , N
−1,N, 1. For this input, w

Prove that the algorithm to find articulation points works.

A sorting algorithm is stable if elements with equal keys are left in the same order as they occur
in the input. Which of the sorting algorithms in this chapter are stable and which are not? Why?

See Full Question And Answer at solutionrank.com

Show how heapsort processes the input 142, 543, 123, 65, 453, 879, 572, 434, 111, 242, 811,
102.

What is the running time of insertion sort if all elements are equal?

Suppose we exchange elements a[i] and a[i+k], which were originally out of order. Prove that at
least 1 and at most 2k − 1 inversions are removed.

Suppose we implement partial path compression on find(i) by making every other node on the
path from i to the root link to its grandparent (where this makes sense). This is known as path
halving. a. Write a procedure to do this. b. Prove that if path halving is performed on the finds
and either union-by-height or uni

In the analysis of mergesort, constants have been disregarded. Prove that the number of
comparisons used in the worst case by mergesort is N[log N] - 2[logN] + 1.

See Full Question And Answer at solutionrank.com

Sort the sequence 3, 1, 4, 1, 5, 9, 2, 6, 5 using insertion sort.

Suppose f (N) is a nicely defined function that reduces N to a smaller integer. What is the
solution to the recurrence T(N) = N/f (N) T(f (N)) + N with appropriate initial conditions?

a. Explain how to modify Dijkstra's algorithm to produce a count of the number of different
minimum paths from v to w. b. Explain how to modify Dijkstra's algorithm so that if there is
more than one minimum path from v to w, a path with the fewest number of edges is chosen.

Using Stirling's formula, N! ≈ (N/e)N √2πN, give a precise estimate for log(N!).
An adjacency matrix requires O(|V|2) merely to initialize using a standard double loop. Propose
a method that stores a graph in an adjacency matrix (so that testing for the existence of an edge is
O(1)) but avoids the quadratic running time.

See Full Question And Answer at solutionrank.com

Write a program that reads N points in a plane and outputs any group of four or more colinear
points (i.e., points on the same line). The obvious brute-force algorithm requires O(N4) time.
However, there is a better algorithm that makes use of sorting and runs in O(N2 logN) time.

For each of the trees in the previous exercise, perform a find with path compression on the
deepest node.

The following divide-and-conquer algorithm is proposed for finding the simultaneous maximum
and minimum: If there is one item, it is the maximum and minimum, and if there are two items,
then compare them and in one comparison you can find the maximum and minimum. Otherwise,
split the input into two halves, divided as e

Section 8.7 described the generating of mazes. Suppose we want to output the path in the maze.
Assume that the maze is represented as a matrix; each cell in the matrix stores information about
what walls are present (or absent). a. Write a program that computes enough information to
output a path in the maze. Give out

a. Give an algorithm to find the minimum number of edges that need to be removed from an
undirected graph so that the resulting graph is acyclic. b. Show that this problem is NP-complete
for directed graphs.

See Full Question And Answer at solutionrank.com

a. In how many ways can two sorted arrays of N elements be merged? b. Give a nontrivial lower
bound on the number of comparisons required to merge two sorted lists of N elements, by taking
the logarithm of your answer in part (a).

When a vertex and its incident edges are removed from a tree, a collection of subtrees remains.
Give a linear-time algorithm that finds a vertex whose removal from an N vertex tree leaves no
subtree with more than N/2 vertices.

If a stack is used instead of a queue for the topological sort algorithm in Section 9.2, does a
different ordering result? Why might one data structure give a "better" answer?

Show that if unions are performed by height, then the depth of any tree is O(logN).

a. Prove that 7 comparisons are required to sort 5 elements using any comparison based
algorithm. b. Give an algorithm to sort 5 elements with 7 comparisons.
See Full Question And Answer at solutionrank.com

Find the strongly connected components in the graph of Figure 9.86.

Suppose you have an array of N elements, containing three distinct keys, true, false, and maybe.
Give an O(N) algorithm to rearrange the list so that all false elements precede maybe elements,
which in turn precede true elements. You may use only constant extra space.

Show the result of running Shellsort on the input 9, 8, 7, 6, 5, 4, 3, 2, 1 using the increments {1,
3, 7}.

Give a linear-time algorithm to sort N fractions, each of whose numerators and denominators are
integers between 1 and N.

Let G be a directed graph with N vertices. A vertex s is called a sink if, for every v in V such that
s ≠v, there is an edge (v, s), and there are no edges of the form (s, v). Give an O(N) algorithm
to determine whether or not G has a sink, assuming that G is given by its N × N adjacency
matrix.

See Full Question And Answer at solutionrank.com

Consider an N-by-N grid in which some squares are occupied by black circles. Two squares
belong to the same group if they share a common edge. In Figure 9.88, there is one group of four
occupied squares, three groups of two occupied squares, and two individual occupied squares.
Assume that the grid is represented by a

Suppose that walls in the maze can be knocked down, with a penalty of P squares. P is specified
as a parameter to the algorithm. (If the penalty is 0, then the problem is trivial.) Describe an
algorithm to solve this version of the problem. What is the running time of your algorithm?

A bipartite graph, G = (V, E), is a graph such that V can be partitioned into two subsets V1 and
V2 and no edge has both its vertices in the same subset. a. Give a linear algorithm to determine
whether a graph is bipartite. b. The bipartite matching problem is to find the largest subset E of E
such that no vertex is

Give an algorithm to decide whether an edge (v, w) in a depth-first spanning forest of a directed
graph is a tree, back, cross, or forward edge.

Suppose arrays A and B are both sorted and both contain N elements. Give an O(logN) algorithm
to find the median of A ∪ B.

See Full Question And Answer at solutionrank.com

Repeat Exercise 7.53 for three numbers. Try to design an O(N2) algorithm. We are given an
array that contains N numbers. We want to determine if there are two numbers whose sum equals
a given number K. For instance, if the input is 8, 4, 1, 6, and K is 10, then the answer is yes (4
and 6). A number may be used twice.

Suppose you are given a sorted list of N elements followed by f (N) randomly ordered elements.
How would you sort the entire list if a. f (N) = O(1)? b. f (N) = O(logN)? c. f (N) = O(√N)? d.
How large can f (N) be for the entire list still to be sortable in O(N) time?

Suppose we want to add the decreaseAllKeys() operation to the heap repertoire. The result of this
operation is that all keys in the heap have their value decreased by an amount Δ. For the heap
implementation of your choice, explain the necessary modifications so that all other operations
retain their running times and

Sort 3, 1, 4, 1, 5, 9, 2, 6 using mergesort.

Find the maximum flow in the network of Figure 9.81.

See Full Question And Answer at solutionrank.com

a. What is the running time of Shellsort using the two-increment sequence {1, 2}? b. Show that
for any N, there exists a three-increment sequence such that Shellsort runs in O(N5/3) time. c.
Show that for any N, there exists a six-increment sequence such that Shellsort runs in O(N3/2)
time.

Show that a graph of V vertices can have VV−2 minimum spanning trees.

a. Show that if M = N2, then the running time of M union/find operations is O(M). b. Show that
if M = N logN, then the running time of M union/find operations is O(M). c. Suppose M = Θ(N
log logN). What is the running time of M union/find operations? d. Suppose M = Θ(N log* N).
What is the running time of M union/

Let G = (V, E) be an undirected graph. Use depth-first search to design a linear algorithm to
convert each edge in G to a directed edge such that the resulting graph is strongly connected, or
determine that this is not possible.

Rewrite heapsort so that it sorts only items that are in the range low to high which are passed as
additional parameters.

See Full Question And Answer at solutionrank.com

The biconnected components of a graph G is a partition of the edges into sets such that the graph
formed by each set of edges is biconnected. Modify the algorithm in Figure 9.69 to find the
biconnected components instead of the articulation points.

Construct a permutation of 20 elements that is as bad as possible for quicksort using median-of-
three partitioning and a cutoff of 3.
Requirements are to be planned for component C5 in product P1. Required deliveries for P1 are
given, and the product structure for P1. Assembly lead time for products and subassemblies (P
and S levels) is 1 week, manufacturing lead times for components (C level) is 2 weeks, and
ordering lead time for raw materials (M l

Design for Manufacturing and Assembly (DFM/A) includes two aspects: (1) organizational
changes and (2) design principles and guidelines. Identify two of the organizational changes that
might be made in implementing DFM/A?

Demand for a certain product is 25,000 units/yr. Unit cost is $10.00. Holding cost rate is 30%/yr.
Changeover (setup) time between products is 10.0 hr, and downtime cost during changeover is
$150/hr. Determine (a) Economic order quantity, (b) Total inventory costs, and (c) Total
inventory cost per year as a propo

See Full Question And Answer at solutionrank.com

What is a reorder point system in inventory control?

Prove that if unions are done by size and path compression is performed, the worstcase running
time is O(Mα(M,N)).

What is rapid prototyping?

The monthly usage for a component supplied to an appliance assembly plant is 5,000 parts.
There are 21 working days in the month and the effective operating time of the plant is 450 min
per day. Currently, the defect rate for the component is 2.2%, and the equipment used to produce
the part is down for repairs an avera

What is production control?

See Full Question And Answer at solutionrank.com

How is production leveling accomplished?

Using the master schedule, and the product structures, determine the time-phased requirements
for component C6 and raw material M6. The raw material used in component C6 is M6. Lead
times are as follows: for P1, assembly lead time is 1 week; for P2, assembly lead time is 1 week;
for S2, assembly lead time is 1 week; fo

A stamping plant supplies sheet metal parts to a final assembly plant in the automotive industry.
The following data are values representative of the parts made at the plant. Annual demand is
150,000 pc (for each part produced). Average cost per piece is $18 and holding cost is 20% of
piece cost. Changeover (setup) tim

You might also like