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

  Hash values

Suppose these names have the following hash values. Insert them into the extendible hash table shown below. Each leaf can only hold 4 entries.

  The time delay of a long-distance

The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication links on the telephone network between the caller and callee

  Implement a state-space search

You will implement a state-space search that will find a solution to the sixteenpuzzle. For this program, in addition to the state-space search control, you will need to implement at least two other classes

  Ford-fulkerson algorithm on capacities

Write code that finds a maximum flow in a directed graph, using the Ford-Fulkerson algorithm on capacities given as matrix void maximum flow(

  Explain pros and cons of algorithm

You can start by taking 3-4 schemes for example and then show each step of the GA based algorithm numerically. Explain each step (selection, cross-over, mutation) in detail. You can show in any way as long as each step is shown and explained numer..

  Create a running shellsort on the input

Create a "Shellsort" I need to create a running Shellsort on the input 9,8,7,6,5,4,3,2,1 using increments 1,3,7.

  Use the string input by the user as an argument to open file

One of these must use preorder traversal, one must use inorder traversal, and one must use postorder traversal. You must decide which to use for each method, but use comments to document the type of traversal used.

  Create a classification tree for the circled items in graph

Create a classification tree for the circled items in the graph. The attributes are the numerical values on the x- and y-axes and the classes are white and black

  Design algorithm to find the average miles per gallon

Design an algorithm to find the average miles per gallon. Sample data: 68723, 71289, 15.75, 16.30, 10.95, 20.65, 30.00.

  Use either the bubble sort or the selection sort algorithms

use either the Bubble Sort or the Selection Sort algorithms

  Relationship between security mechanisms and attacks

Draw a matrix similar that shows the relationship between security mechanisms and attacks - Show the calculations for corresponding decryption of the ciphertext to recover the original plaintext.

  Explain the binary search tree search algorithm

How do you know if a graph is a binary tree? Explain the preorder traversal algorithm. Explain the binary search tree search algorithm.

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