Design map reduce algorithms

Assignment Help Data Structure & Algorithms
Reference no: EM131221499

Q1. Prove or disprove each of the following relational algebra identities. These means that if they are true of all relations R and S of the same arity, then give a formal proof, otherwise provide a counterexample of two relations R and S of the same arity for which the identity fails.

(a) π1,2(R) U π1,2(S) = π1,2(R U S)

(b) π1,2(R) ∩ π1,2(S) = π1,2(R ∩ S)

(c) π1,2 (R \ S) = π1,2(R) \ π1,2(S)

(d) σ1=a(R \ S) = σ1=a(R)\ σ1=a(S)

Q2. Consider the relational schema about drinkers, beers, and bars, from the lecture slides "Relational algebra and SQL," slides nos. 31 and 32.

Express the following queries in (i) relational algebra, and in (ii) SQL

(a) Print the bars that serve a beer that drinker Bill likes.

(b) Print the drinkers that frequent at least one bar that serves a beer they like.

(c) Print the drinkers that frequent only bars that serve some beer they like. (Assume each drinker likes at least one beer and frequents at least one bar.)

(d) Print the drinkers that frequent no bar that serves a beer that they like.

Q3. Design Map Reduce algorithms to take a very large file of integers and produce as output:

(a) The largest integer.

(b) The average of all integers.

(c) The same set of integers, but with each integer appearing only' once.

(d) The count of the number of distinct integers in the input.

Q4. In the form of relational algebra implemented in SQL, relations are not sets, but bags; that is, tuples are allowed to appear more than once. There are extended definitions of union, intersection, and difference for bags, which we shall define below. Write Map Reduce algorithms for computing the following operations on bags R and S:

(a) Bag Union, defined to be the bag of tuples in which tuple t app ears the sum of the numbers of times it appears in R and S.

(b) Bag Intersection, defined to be the bag of tuples in which tuple t appears the minimum of the numbers of times it appears in R and S.

(c) Bag Difference, defined to be the bag of tuples in which the number of times a tuple t appears is equal to the number of times it appears in R minus the number of times it appears in S. A tuple that appears more times in S than in R does not appear in the difference.

Q5. The Hamming distance between a pair of bit-strings of the same length is the number of bits in which they differ.

Design a map-reduce algorithm that takes as input a (huge) set of bit-strings of length b, and outputs all pairs of strings that are at most distance d from each other.

Reference no: EM131221499

Questions Cloud

How much thought have you given to the way you practice : How much thought have you given to the way you practice engineering and its relationship to the quality of work you and your company succeeds?
Compute the mahalanobis distance between the origin : Suppose a cluster of three-dimensional points has standard deviations of 2, 3, and 5, in the three dimensions, in that order. Compute the Mahalanobis distance between the origin (0, 0, 0) and the point (1, -3, 4).
Discuss three aspects of the american judicial system : An analysis of at least three aspects of the American judicial system (such as eyewitness testimony, transfer of juveniles to criminal court, etc.), which are impacted most heavily by psychology and psychological research (3 pages). Be sure to dis..
Worldview impact personal reactions : Within difficult circumstances how can a worldview impact personal reactions? Within positive circumstances how can a worldview impact personal reactions?
Design map reduce algorithms : Design Map Reduce algorithms to take a very large file of integers and produce as output: The largest integer.  The average of all integers. The same set of integers, but with each integer appearing only' once
What potential synergies drove the merger : Summarize the chronology of events from the first offer that was made by the acquiring firm until the final acquisition was agreed. Include information about other firms that were involved, even in an indirect manner (for example, where there any “wh..
Compute the radius in the sense used by the grgpf algorithm : Compute the radius, in the sense used by the GRGPF Algorithm (square root of the average square of the distance from the clustroid) for the cluster that is the five points in the lower right of Fig. 7.8. Note that (11,4) is the clustroid.
Prepare t-accounts for accounts receivable : During the year FC estimated doubtful accounts expense at 1% of credit sales. At year end, FC ages its accounts receivable and adjusts the balances in Allowance for Doubtful Accounts to correspond to the aging schedule. Prepare an aging schedule. Pre..
Distinction between good nervousness and bad nervousness : Many musicians and performers make a distinction between "good nervousness" and "bad nervousness" - What do you think this distinction means? How does it apply to public speaking?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Create a map and store the names with associated student id

Display the values from the priority queue using the peek() method. Describe your observation of change to the list of names in the report file.

  Write a c function to compute balance factor of binary tree

Write a C function to compute the balance factor of a binary tree. If it is called initially with the root pointer, it should determine the balance factor of the entire tree.

  Calculate the correlations between er and pgr

Calculate the correlations between er and pgr, b1 and b2, and p1 and p2 (three correlations). What do these tell you about the relationships between these variables

  Discrete perceptron learning algorithm

Implement a classifier for characters L and I using the discrete perceptron learning algorithm. You may use any implementation, Specifications: Use a 3 x 3 binary matrix representation

  Write an algorithm that finds sum of the degrees for a node

Write an algorithm that finds the sum of the degrees for a node, using the adjacency list representation.

  What are digital downloads and digital compression

What can be digitally downloaded and compressed?

  Suppose n gt 1 is a natural number and f z rarrn upsilon 0

suppose n gt 1 is a natural number and f z rarrn upsilon 0 is the function that associates with each a epsilon z its

  Write algorithm that allows the customer to enter amount

An ATM allows a customer to withdraw a maximum of $500 per day. If a customer withdraws more than $300, the service charge is 4% of the amount over $300.

  B+-tree

For the B+-tree where M=3 and L=5 shown below, show how an insert of value 80 is handled.

  Discuss how concurrency control mechanism interacts

Describe, with examples, the types of problem that can occur in a multi-user environment when concurrent access to the database is allowed. Give full details of a mechanism for concurrency control that can be used to ensure that the types of probl..

  Design a complete algorithm or draw a flowchart

Design a complete algorithm or draw a flowchart that determines the sales tax on purchases under $1.00 for a state with a 7% sales tax rate. Display the sales tax amount if the number of cents entered was 99 or less; otherwise, display an error me..

  What is an algorithm

What is an algorithm? Find one on-line example of an algorithm (try to find one that solves any math problem), and repeat (retype and/or copy by taking a screen shot) that algorithm into your homework submittal

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