2018-09-18

Sep 19 In-Class Exercise Thread.

Please post your solutions to the Sep 19 In-Class Exercise to this thread.
Chris
Please post your solutions to the Sep 19 In-Class Exercise to this thread. Chris
2018-09-19

-- Sep 19 In-Class Exercise Thread
1. Since {A,B}≠∅ we execute the while loop at least once, and set Xold={A,B}. first while loop: step 1 would be BC→D, B,C ∈{A,B} are not valid so no changes step 2 would be D→E, so no changes step 3 would be AB→C, A,B∈{A,B} so we add C to X. X becomes X={A,B,C} step 4 would be BC→A, so no changes step 5 would be CF→B, so no changes while loop second time: step 6 would be BC→D, B,C ∈{A,B,C} are valid, so X becomes X={A,B,C,D} step 7 would be D→E, so X becomes X={A,B,C,D,E} it would take one more while loop
2.{C,D,F}
BC→D, no change D→E, X becomes X={C,D,E,F} AB→C, no change BC→A, no change CF→B, X becomes X={B,C,D,E,F} BC→D, no change D→E, no change AB→C, no change BC→A, X becomes X={A,B,C,D,E,F}
(Edited: 2018-09-19)
1. Since {A,B}≠∅ we execute the while loop at least once, and set Xold={A,B}. first while loop: step 1 would be BC→D, B,C ∈{A,B} are not valid so no changes step 2 would be D→E, so no changes step 3 would be AB→C, A,B∈{A,B} so we add C to X. X becomes X={A,B,C} step 4 would be BC→A, so no changes step 5 would be CF→B, so no changes while loop second time: step 6 would be BC→D, B,C ∈{A,B,C} are valid, so X becomes X={A,B,C,D} step 7 would be D→E, so X becomes X={A,B,C,D,E} it would take one more while loop 2.{C,D,F} BC→D, no change D→E, X becomes X={C,D,E,F} AB→C, no change BC→A, no change CF→B, X becomes X={B,C,D,E,F} BC→D, no change D→E, no change AB→C, no change BC→A, X becomes X={A,B,C,D,E,F}

-- Sep 19 In-Class Exercise Thread
Student Name: Alexander Duong
1. Since the order is different, this causes the algorithm to go through the while loop one more time. 2. 1. X={C,D,F} 2. Skip BC->D since B is not in X. 3. X={C,D,E,F} since D->E and D is in X. 5. Skip AB->C since B is not in X. 6. Skip BC->A since B is not in X. 7. X={B,C,D,E,F} since CF-> B and CF is in X 8. Go through while loop again. 9. Skip BC->D since BC is already in X. 10. Skip AB->C since A is not in X 11. X={A,B,C,D,E,F} since BC->A and BC is already in X. 12. Go through while loop again. 13. Nothing is changed. Therefore the output value of {C,D,F} is {A,B,C,D,E,F}
(Edited: 2018-09-19)
Student Name: Alexander Duong <nowiki> 1. Since the order is different, this causes the algorithm to go through the while loop one more time. 2. 1. X={C,D,F} 2. Skip BC->D since B is not in X. 3. X={C,D,E,F} since D->E and D is in X. 5. Skip AB->C since B is not in X. 6. Skip BC->A since B is not in X. 7. X={B,C,D,E,F} since CF-> B and CF is in X 8. Go through while loop again. 9. Skip BC->D since BC is already in X. 10. Skip AB->C since A is not in X 11. X={A,B,C,D,E,F} since BC->A and BC is already in X. 12. Go through while loop again. 13. Nothing is changed. Therefore the output value of {C,D,F} is {A,B,C,D,E,F} </nowiki>

-- Sep 19 In-Class Exercise Thread
{A, B} =x.old We run through all of the FDs to obtain {A,B,C} {A, B, C} =x.old {A,B,C,D} - >{A, B, C, D, E} {A, B, C, D, E} =x.old Nothing changes so the while loop is finished executing.
{C, D, F} = x.old {C,D,F,E} - > {C,D,F,E,B} {C, D, F, E, B} = x.old {C,D,F,E,B} - > {C, D, F, E, B, A} {C,D,F,E,B,A} =x.old Nothing is added, so the while loop terminates.
{A, B} =x.old We run through all of the FDs to obtain {A,B,C} {A, B, C} =x.old {A,B,C,D} - >{A, B, C, D, E} {A, B, C, D, E} =x.old Nothing changes so the while loop is finished executing. {C, D, F} = x.old {C,D,F,E} - > {C,D,F,E,B} {C, D, F, E, B} = x.old {C,D,F,E,B} - > {C, D, F, E, B, A} {C,D,F,E,B,A} =x.old Nothing is added, so the while loop terminates.

-- Sep 19 In-Class Exercise Thread
1. first run the loop once set X = {A,B};
 step 2:then BC-> D, BC not in X; 
 step 3: D->E, D not in X;
 step 4: AB ->C  => X = {A,B,C};
 step 5: BC -> A, A in X already;
 step 6: CF->B, B in X already;
 step 7: BC-> D=> X ={A,B,C,D}
 step 8: D->E => X ={A,B,C,D,E};
 step 9: AB->C no change;
 step 10: BC -> A no change;
 step 11: CD -> B no change;
 step 12: run the loop one more time without any change;
 there are 7 more steps.
2:first foe each get X = {C,D,F}; AB->C no change; BC - > A no change; D-> E => X ={C,D,F,E}; CF -> B => X ={C,D,F,E,B}; Second time run the while loop: AB->C no change; BC-> A => X = {A,B,C,D,E,F}; D-> E and CF -> B no change; run the for each one more time without any change; return X
1. first run the loop once set X = {A,B}; step 2:then BC-> D, BC not in X; step 3: D->E, D not in X; step 4: AB ->C => X = {A,B,C}; step 5: BC -> A, A in X already; step 6: CF->B, B in X already; step 7: BC-> D=> X ={A,B,C,D} step 8: D->E => X ={A,B,C,D,E}; step 9: AB->C no change; step 10: BC -> A no change; step 11: CD -> B no change; step 12: run the loop one more time without any change; there are 7 more steps. 2:first foe each get X = {C,D,F}; AB->C no change; BC - > A no change; D-> E => X ={C,D,F,E}; CF -> B => X ={C,D,F,E,B}; Second time run the while loop: AB->C no change; BC-> A => X = {A,B,C,D,E,F}; D-> E and CF -> B no change; run the for each one more time without any change; return X

-- Sep 19 In-Class Exercise Thread
1. BC -> D = no changes 2. D -> E = no changes 3. AB -> C = add C to X since A,B is an element of {A, B}
   X = {A, B, C}
4. BC -> A = no changes 5. CF -> B = no changes 6. BC -> D = add D to X since B, C is an element of {A, B, C}
   X = {A, B, C, D}
7. D -> E = add E
   X = {A, B, C, D, E}
{C, D, F} 8. BC -> D = no changes 9. D -> E = E is added
   X = {C, D, E, F}
10. AB -> C = no changes 11. BC -> A = no changes 12. CF -> B = B is added
    X = {B, C, D, E, F}
13. BC -> D = no changes 14. D -> E = no changes 15. AB -> C = no changes 16. BC -> A = A is added
    X = {A, B, C, D, E, F}
1. BC -> D = no changes 2. D -> E = no changes 3. AB -> C = add C to X since A,B is an element of {A, B} X = {A, B, C} 4. BC -> A = no changes 5. CF -> B = no changes 6. BC -> D = add D to X since B, C is an element of {A, B, C} X = {A, B, C, D} 7. D -> E = add E X = {A, B, C, D, E} {C, D, F} 8. BC -> D = no changes 9. D -> E = E is added X = {C, D, E, F} 10. AB -> C = no changes 11. BC -> A = no changes 12. CF -> B = B is added X = {B, C, D, E, F} 13. BC -> D = no changes 14. D -> E = no changes 15. AB -> C = no changes 16. BC -> A = A is added X = {A, B, C, D, E, F}

-- Sep 19 In-Class Exercise Thread
Resource Description for 180919InClass.png
((resource:180919InClass.png|Resource Description for 180919InClass.png))

-- Sep 19 In-Class Exercise Thread
1. Due to the different order in the FDs, the effect is that the while loop will run thrice this time instead of just twice like before.
After the first run of the while loop, X={A,B,C}.
After the second run of the while loop, X = {A,B,C,D,E}
And the third run does not change X.
Since the same set of FDs are used, albeit in a different order, hence the result of the closure of {A,B} will be the same, with X = {A,B,C,D,E}
2. Closure of {C,D,F} using FDs BC→D, D→E, AB→C, BC→A, and CF→B
Step 1: BC→D, D→E, AB→C, BC→A, and CF→B
Since {C,D,F}≠∅ execute while loop first time.
Set Xold={C,D,F}
Execute for each loop
first time: FD BC→D, B,C not∈{C,D,F}, no change to X.
second time: FD D→E, D∈{C,D,F}, add E to X, X = {C,D,E,F}
third time: FD AB→C, A,B not∈{C,D,E,F}, no change to X.
fourth time: FD BC→A, B,C not∈{C,D,E,F}, no change to X.
fifth time: FD CF→B, C,F∈{C,D,E,F}, add B to X, X = {B,C,D,E,F}
Since X={B,C,D,E,F} and Xold={C,D,F}, loop second time:
Set Xold={B,C,D,E,F}
Execute for each loop
first time: FD BC→D, no change to X.
second time: FD D→E, no change to X.
third time: FD AB→C, A,B not∈{B,C,D,E,F}, no change to X.
fourth time: FD BC→A, B,C∈{B,C,D,E,F}, add A to X. X = {A,B,C,D,E,F}
fifth time: FD CF→B, no change to X.
Since X={A,B,C,D,E,F} and Xold={B,C,D,E,F}, loop third time:
No change in X, so closure of {C,D,F} is X={A,B,C,D,E,F}
(Edited: 2018-09-19)
1. Due to the different order in the FDs, the effect is that the while loop will run thrice this time instead of just twice like before. After the first run of the while loop, X={A,B,C}. After the second run of the while loop, X = {A,B,C,D,E} And the third run does not change X. Since the same set of FDs are used, albeit in a different order, hence the result of the closure of {A,B} will be the same, with X = {A,B,C,D,E} 2. Closure of {C,D,F} using FDs BC→D, D→E, AB→C, BC→A, and CF→B Step 1: BC→D, D→E, AB→C, BC→A, and CF→B Since {C,D,F}≠∅ execute while loop first time. Set Xold={C,D,F} Execute for each loop first time: FD BC→D, B,C not∈{C,D,F}, no change to X. second time: FD D→E, D∈{C,D,F}, add E to X, X = {C,D,E,F} third time: FD AB→C, A,B not∈{C,D,E,F}, no change to X. fourth time: FD BC→A, B,C not∈{C,D,E,F}, no change to X. fifth time: FD CF→B, C,F∈{C,D,E,F}, add B to X, X = {B,C,D,E,F} Since X={B,C,D,E,F} and Xold={C,D,F}, loop second time: Set Xold={B,C,D,E,F} Execute for each loop first time: FD BC→D, no change to X. second time: FD D→E, no change to X. third time: FD AB→C, A,B not∈{B,C,D,E,F}, no change to X. fourth time: FD BC→A, B,C∈{B,C,D,E,F}, add A to X. X = {A,B,C,D,E,F} fifth time: FD CF→B, no change to X. Since X={A,B,C,D,E,F} and Xold={B,C,D,E,F}, loop third time: No change in X, so closure of {C,D,F} is X={A,B,C,D,E,F}
2018-09-21

-- Sep 19 In-Class Exercise Thread
Resource Description for IMG_1282.jpeg Resource Description for IMG_1281.jpeg
((resource:IMG_1282.jpeg|Resource Description for IMG_1282.jpeg)) ((resource:IMG_1281.jpeg|Resource Description for IMG_1281.jpeg))

-- Sep 19 In-Class Exercise Thread
Resource Description for IMG_3096.jpg
((resource:IMG_3096.jpg|Resource Description for IMG_3096.jpg))
[ Next ]
X