2019-09-17

Sep 18 In-Class Exercise Thread .

Post your solutions to the Sep 18 In-Class Exercise to this thread.

Best,

Chris

Post your solutions to the Sep 18 In-Class Exercise to this thread. Best, Chris
2019-09-18

-- Sep 18 In-Class Exercise Thread

X = {A,D,F} iterating through the Fd-> X = {A, D , F , E} Xold = X

closure returned {A,D,F,E}

(Edited: 2019-09-18)
X = {A,D,F} iterating through the Fd-> X = {A, D , F , E} Xold = X closure returned {A,D,F,E}

-- Sep 18 In-Class Exercise Thread

First while round: X old = {A, D, F}; after for loop X = {A, D, F, E} Second while round: X old = {A, D, F, E}; after for loop X = {A, D, F, E} while condition failed b/c X old == X. return X = {A, D, F, E}

(Edited: 2019-09-18)
First while round: X old = {A, D, F}; after for loop X = {A, D, F, E} Second while round: X old = {A, D, F, E}; after for loop X = {A, D, F, E} while condition failed b/c X old == X. return X = {A, D, F, E}

-- Sep 18 In-Class Exercise Thread

X = {A,D,F} iterate through FD-> X = {A, D , F , E} Xold = X Does not change {A,D,F,E}

(Edited: 2019-09-18)
X = {A,D,F} iterate through FD-> X = {A, D , F , E} Xold = X Does not change {A,D,F,E}

-- Sep 18 In-Class Exercise Thread

Xold = {A,D,F} BC -> D no change BC -> A no change D -> E we have {A,D, F, E} CF -> B no change AB -> C no change

X = {A,D, F, E}

(Edited: 2019-09-18)
Xold = {A,D,F} BC -> D no change BC -> A no change D -> E we have {A,D, F, E} CF -> B no change AB -> C no change X = {A,D, F, E}

-- Sep 18 In-Class Exercise Thread

'''1.''' X = {A,B} BC -> D, doesn't change BC -> A, doesn't change D -> E, doesn't change CF -> B, doesn't change AB -> C, X = {A, B, C}

X = {A, B, C} BC -> D, X = {A, B, C, D} BC -> A, doesn't change D -> E, X = {A, B, C, D, E} CF -> B, doesn't change AB -> C, doesn't change

The last iteration doesn' change X

'''2.''' X = {A,D,F} BC -> D, doesn't change BC -> A, doesn't change D -> E, X = {A, D, F, E} CF -> B, doesn't change AB -> C, doesn't change

X = {A, D, F, E} not equal to Xold = {A, D, F} BC -> D, doesn't change BC -> A, doesn't change D -> E, doesn't change CF -> B, doesn't change AB -> C, doesn't change

so X = {A, D, F, E} is the eventually output as the value of {A, D, F}+

(Edited: 2019-09-18)
'''1.''' X = {A,B} BC -> D, doesn't change BC -> A, doesn't change D -> E, doesn't change CF -> B, doesn't change AB -> C, X = {A, B, C} X = {A, B, C} BC -> D, X = {A, B, C, D} BC -> A, doesn't change D -> E, X = {A, B, C, D, E} CF -> B, doesn't change AB -> C, doesn't change The last iteration doesn' change X '''2.''' X = {A,D,F} BC -> D, doesn't change BC -> A, doesn't change D -> E, X = {A, D, F, E} CF -> B, doesn't change AB -> C, doesn't change X = {A, D, F, E} not equal to Xold = {A, D, F} BC -> D, doesn't change BC -> A, doesn't change D -> E, doesn't change CF -> B, doesn't change AB -> C, doesn't change so X = {A, D, F, E} is the eventually output as the value of {A, D, F}+

-- Sep 18 In-Class Exercise Thread

X={A,D,E,F} would be output as the value of {A,D,F}+. since only the FDs D→E will add E to the output

X={A,D,E,F} would be output as the value of {A,D,F}+. since only the FDs D→E will add E to the output

-- Sep 18 In-Class Exercise Thread

Reordering the clauses does not affect the answer but affects the number of time we have to go through the while loop. <br> <br> before the loop <br> let X:={A, D, F} <br> <br> while <br> Xold := X := {A, D, F} <br> <br> After one iteration of the while loop: Xold = {A, D, F} & X = {A, D, F, E} <br> After two iteration of the while loop: Xold = {A, D, F, E} & X = {A, D, F, E} <br>

(Edited: 2019-09-18)
Reordering the clauses does not affect the answer but affects the number of time we have to go through the while loop. <br> <br> before the loop <br> let X:={A, D, F} <br> <br> while <br> Xold := X := {A, D, F} <br> <br> After one iteration of the while loop: Xold = {A, D, F} & X = {A, D, F, E} <br> After two iteration of the while loop: Xold = {A, D, F, E} & X = {A, D, F, E} <br>

-- Sep 18 In-Class Exercise Thread

{A, D, F} for D -&gt; E adding E -&gt; {A, D, F, E}

{A, D, F} for D -> E adding E -> {A, D, F, E}

-- Sep 18 In-Class Exercise Thread
  1. Reordering the FDs causes the algorithm to go through the while loop one extra time (3 times), but the closure is still {A, B, C, D, E}

1st pass: {A,B}+ = {A,B,C}

2nd pass: {A,B}+ = {A,B,C,D,E}

3rd pass: {A,B}+ wouldn&#039;t change and the algorithm would stop

  1. {A, D, F}+ = {A, D, F, E} would be the answer

after the first pass in the while loop (since only the D -&gt; E Functional Dependency would be added), and the second pass would not change {A,D,F}+ so the algorithm would end there.

(Edited: 2019-09-18)
1. Reordering the FDs causes the algorithm to go through the while loop one extra time (3 times), but the closure is still {A, B, C, D, E} 1st pass: {A,B}+ = {A,B,C} 2nd pass: {A,B}+ = {A,B,C,D,E} 3rd pass: {A,B}+ wouldn't change and the algorithm would stop 2. {A, D, F}+ = {A, D, F, E} would be the answer after the first pass in the while loop (since only the D -> E Functional Dependency would be added), and the second pass would not change {A,D,F}+ so the algorithm would end there.
[ Next ]
X