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

  Program to create huffman codes

Write a C++ program to create Huffman codes. Program input is a file called freq.txt (make up your own file for testing) that contains data on the characters in some cleartext file in the form of each character's non-zero frequency of occurrence i..

  What is the best algorithm for sorting

What is the best algorithm for sorting each of the following: general comparable objects, long character strings, double precision floating point numbers, 32-bit integers, and bytes? Justify your answer.

  What would happen if that information were compromised

What rights to privacy do people have when using the Internet at home? Are their privacy rights limited? Do those same rights and limits exist at work? Explain your answer.

  Q1 compare the average behavior of insertion sort for n

q1 compare the average behavior of insertion sort for n elements with that of the n insertions into an initially-empty

  Create algorithm to count of integers less than average

Create the algorithm which will prompt for and get 10 integers from the operator at terminal, and then count number of integers whose value is less than average value of integers.

  Lines of action- explain how you will use a search tree to

lines of action- explain how you will use a search tree to find the solutionbullabstractbullintroductionbullrelated

  Write a function with the heading function nonodes

Write a function with the heading: function NoNodes( t : treeptr) : natural whose value is the number of nodes on the tree t.

  Create a recursive backtracking solution

The columns and rows of the matrix are the regions while the cells contain a 0 if the two regions are not adjacent and a 1 if they border. Create a recursive backtracking solution which accepts as interactive input from the user the number of regi..

  Explain the fundamental concepts of cryptographic algorithms

Explain the fundamental concepts of cryptographic algorithms. Examine malicious activities that may affect the security of a computer program and justify the choice of various controls to mitigate threats.

  Truth teller problem

Assume you were in a nation where each person was either a truth teller or a liar. Determine what single question could you ask a person that would permit you to detect whether that person was a truth teller or a liar?

  Sql based question

In order to make the SQL select statements that would manufacture running summary files for reports of the above; how would you answer the questions below?

  Data structures for a single algorithm

Data structures for a single 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