
Implement in Python / Java
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) * )
- {for each column j representing attribute Aj
- {if (relation Ri includes attribute Aj ) then set S(I, j):=aj;};};
- (* each aj is a distinct symbol associated with index (j) *)
3. For each row i representing relation schema Ri
- {for each functional dependency X → Y in F
- {for all rows in S which have the same symbols in the columns
- corresponding to attributes in X
- {make the symbols in each column that correspond to
- an attribute in Y be the same in all these rows as
- follows: if any of the rows have an "a" symbol for the
- the column set the other rows to that same "a" symbol
- the column. If no "a" symbol exists for the attribute
- in any of the rows, choose one of the "b" symbols
- that appear in one of the rows for the attribute and set
- the other rows to that same "b" symbol in the
- 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

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- Pick the option that is correct for A, B, C, D (A) Element defintion or Hypothesis (B) Exsistential generaliztion 1, 2 or Exsistential instantaion 1, 2 or Universal generaliztion 1, 2 or Universal instantaion 1, 2 (C) Q(b) ^ R(b) or Q(b) ∨ R(b) or Q(x) ^ R(x) or Q(x) ∨ R(x) (D) ∀Q(x) or ∀¬Q(x) or ∃Q(x) or ∃¬Q(x)arrow_forwardGiven set A={1,2,3,4,5} and let R and S be a binary relation on set A. ? = {(?, ?) ? ??? | ?|? } ??? ? = {(2,1), (2,3), (3,4), (3,5), (4,5)} a.) Evaluate the Domain and Range of SoR. b.) Evaluate (???) −1 ??? ??? ̅̅̅̅̅.arrow_forwardSuppose that we decompose the schema R = (A, B, C, D, E) into (A, B, C) (A, D, E). Show that this decomposition is a lossless decomposition if the following set F of functional dependencies holds: A → BC CD → E B → D E → Aarrow_forward
- Adjacency matrix. Given a relation relation (as a numpy.array, see example below) and number of nodes n, define a function adjacency to construct the adjacency matrix A (as a numpy.array).You can assume that n is a positive integer and treat relation as a list of directed edges. # Example from p112 of VMLSrelation = np.array([[1, 2], [1, 3], [2, 1], [2, 4], [3, 4], [4, 1]])n = 4 # Modify the function adjacency below with your answer for Q8def adjacency(relation, n): A = None ########################### ### YOUR CODE HERE ######## ## REMOVE THIS LINE-------- raise NotImplementedError() ## ------------------------ ########################### return Aarrow_forwardBarrow_forwardMake sure to show the correct work and solution:arrow_forward
- Let relations r1(A, B, C) and r2(C, D, E) have the following properties: r1 has20,000 tuples, r2 has 45,000 tuples, 25 tuples of r1 fit on one block, and 30tuples of r2 fit on one block. Estimate the number of block transfers and seeksrequired using each of the following join strategies for r1 ⋈ r2: Hash join.arrow_forwardConsider an equivalence relation R on X={a,b,c}. R= {(a,a), (a,c), (b,b), (c,a), (c,c) } [a]=arrow_forwardImplement the following Racket functions: Symmetric-Closure Input: a list of pairs, L. Interpreting L as a binary relation, Symmetric-Closure should return the symmetric closure of L. Examples: (Symmetric-Closure '((a a) (a b) (b a) (b c) (c b))) ---> '((a a) (a b) (b a) (b c) (c b)) (Symmetric-Closure '((a a) (a b) (a c))) ---> '((a a) (a b) (a c) (b a) (c a)) (Symmetric-Closure '((a a) (b b))) ---> '((a a) (b b)) (Symmetric-Closure '()) ---> '() You must use recursion, and not iteration. You may not use side-effects (e.g. set!).arrow_forward
- Given a world map in the form of a Generic M-ary Tree consisting of N nodes and an array of queries[], the task is to implement the functions Lock, Unlock and Upgrade for the given tree. For each query in queries[], the functions return true when the operation is performed successfully, otherwise, it returns false. The functions are defined as: X: Name of the node in the tree and will be uniqueuid: User Id for the person who accesses node X 1. Lock(X, uid): Lock takes exclusive access to the subtree rooted.- Once Lock(X, uid) succeeds, then lock(A, any user) should fail, where A is a descendant of X.- Lock(B. any user) should fail where X is a descendant of B.- Lock operation cannot be performed on a node that is already locked. 2. Unlock(X, uid): To unlock the locked node.- The unlock reverts what was done by the Lock operation.- It can only be called on same and unlocked by same uid. 3. UpgradeLock(X, uid): The user uid can upgrade their lock to an ancestor node.- It is only possible…arrow_forward1. A known relationship mode of R (U, F), U= (A, B, C, E, F, G, H, I, J, G); F={AB->E,ABE->FG, B->FI, C->J, CJ->I, G->H}; find the minimum cover of F, then use theNormal Form decomposition algorithm to decompose this mode to 3NF, and check if thedecomposition has the nonadditive join property.arrow_forward5. Let S = {a,b,c,d}, T = {a, c, e, f}, R = {c, f}. Find the following sets.... (a) SUT (b) SnT (c) SU (TNR) (d) T-R (e) Sketch a Venn diagram showing how S, T, and R relate to each other. (f) Let f: R→ R be given by f (x) = 3x - 2. Prove that f (x) is one-to-one and onto.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





