Implement in Python / Java

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Implement in Python / Java

Algorithm: Testing for lossless (nonadditive) join property.

Input: A universal relation R, a decomposition D = { R1, R2, R3, ….. Rm } of R, and a set F of functional dependencies.

1. Create an initial matrix S with one row i for each relation in Ri in D, and one column j for each attribute Aj in R.

2. Set S(i, j) := bij for all matrix entries. (* each bij is a distinct symbol associated with indices (i, j) * )

  1. {for each column j representing attribute Aj  
  2.                                {if (relation Ri includes attribute Aj ) then set S(I, j):=aj;};};  
  3.           (* each aj is a distinct symbol associated with index (j) *)  

3. For each row i representing relation schema Ri

  1. {for each functional dependency X  → Y in F  
  2.          {for all rows in S which have the same symbols in the columns     
  3.          corresponding to attributes in X  
  4.   
  5.             {make the symbols in each column that correspond to     
  6.                            an attribute in Y be the same in all these rows as     
  7.                                follows: if any of the rows have an "a" symbol for the    
  8.                                the column set the other rows to that same "a" symbol            
  9.                              the column. If no "a" symbol exists for the attribute    
  10.                                in any of the rows, choose one of the "b" symbols   
  11.                              that appear in one of the rows for the attribute and set   
  12.                                    the other rows to that same "b" symbol in the                 
  13.              column ;};};};  

4. Repeat the following loop until a complete loop execution results in no changes to S

5. If a row is made up entirely of "a" symbols, then the decomposition has the lossless join property; otherwise, it does

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY