Wednesday 9 April 2008

Lecture Review Week 11

This shall be the last weekly review for this semester since the examinations will only be testing on topics till this week, and some of the modules have already finished the lecture series.


Database --- The last topic of this module is Normalization. The motivation for this is to remove anomalies in the relations by decomposing the table to smaller tables. For this module, we only need to learn 2NF, 3NF, and BCNF.

Relations in BCNF are certainly in 3NF and 2NF as well. Here's the conditions for each of the three cases:

2NF: for functional dependency in the relation like this {A}->{B}
A is not a proper subset of the candidate key or
B is a part of any candidate key

3NF: for functional dependency in the relation like this {A}->{B}
A is a super key or
B is a part of some candidate key

BCNF(Boyce Codd Normal Form): for functional dependency (F.D.) in the relation like this {A}->{B}
A is a super key

Apart from identifying the different normal forms, obviously, u need to know how to decompose the original relations. The first algorithm breaks the relation R, down to BCNF.

First identify the F.D. that violates BCNF, and we calculate the closure for the LHS of this F.D.

{LHS}+ = {some attributes}

Remove the attributes from R to form R1, and another R2 which consists of the remaining attributes in R union with LHS. Then check for both R1 and R2 that F.D.1 and F.D.2 satisfy with BCNF. If any of them does not satisfy, break that relation further until it satisfy.

This algorithm is not dependency preserving.

Another algorithm is to break R into 3NF:

First, you have to calculate the minimal cover for F.D. the method is in Lecture Review 10. Then re-combine the minimal cover having the same LHS to get the extended minimal cover.

With this extended minimal cover, we create R1, R2, ...., with each of the dependencies. Then we check that none of the relations is contained in another relation. Remove the one that is contained. Then check that at least one of the R contains the candidate key, if not, create another relation with only the candidate key.


Artificial Intelligence --- The last topic is machine learning. It's probably one of the easier topic for this module. For this topic, there are a series of test cases. From these cases, we are to construct a decision tree to predict the outcome for other values.

The decision tree is constructed with some form of algorithm calculating the information gain from choosing the different attributes as the root node. However, it seems more intuitive to construct it by observation at times. The chosen attribute should reduce the entropy of the test cases the most.

Software Engineering --- We continued with testing of the software. This week is white box testing. To do this form of testing, we have to consider the internal functioning of the codes. Looking at the codes, we draw the Control Flow Graph (CFG), then use test cases to test each of the possible routes, varying each time by one single path.

Tuesday 1 April 2008

Lecture Review Week 10

Database --- This week is the last second chapter of the semester. And since I've posted this after the tutorial, it seems that functional dependency ain't that difficult.

Given a relation scheme R, with attributes A, B, C, D, E, and a set of functional dependency F = { {A->B}, {C->D}, {B,D->A}, {D->B,E}}. The key concept here is to be able to find the closure of the different attributes. From there, find the super key, candidate key and the minimal cover for the relation.

{A}+ = {A,B,}
{B}+ = {B}
{C}+ = {C,D,B,E,A}
{D}+ = {D,B,E,A}
{E}+ = {E}

Therefore, the super keys will be {C}, and anything that contains C and {C} is a candidate key.

To find minimal cover,
step 1: Break the RHS in F to get F'.
F' = { {A->B}, {C->D}, {B.D->A}, {D->B}, {D->E} }

step 2: Break the LHS in F' to get F'', refer to the closure for each of the attributes to see which attribute on the LHS should be kept.
F''= { {A->B}, {C->D}, {D->A}, {D->B}, {D->E} }

step 3: Remove redundant implications from F'' to get F'''
F'''= { {A->B}, {C->D}, {D->A}, {D->E} } in here {D->B} is removed because it can be formed by transitivity from { {A->B}, {D->A} }


Business Law --- In the concluding lecture, the topic was on Directors' Duties. It is divided into three parts. Fiduciary duties, care and skill, and statutory duties. Under fiduciary duties, it can be sub-divided into four more categories, the most important should be the conflict of interest, where it is also sub-divided into four more categories. This conflict occurs where the director has share of the company they are dealing with, and depending on the situation, the contract might be fatal. In case of such conflict, the director should declare the conflict.

In care and skill, the director has to exercise what he knows and within their ability for the benefit of the company, then he should be fine. The degree of skill is dependent on the director's qualification.

In statutory duties, it is what is stated by law that the director should do. To list out the duties is gonna take forever..


Business Correspondence ---
The concluding for this module as well, is the final part to Oral Presentation. In here, we went on to the final step of the 5-step model for TOPP, and is to deliver the goods.

This focuses on the pronunciation of words must be accurate, the tone of the talk must not be monotonous. Apart from being able to articulate your ideas across the audience, you must be watch out for the postures, hand movements, positioning of yourself when using visual aids and so on. Try to be natural and talk to the audience. Maintaining eye contact for a while instead of looking everywhere in the audience. Quite standard but not easy to do. Practice makes perfect.


Artificial Intelligence ---
This time was on probability. After taking probability for one semester, I thought I was done, but this lecture really brings back bad memory. Lucky it's not so in depth like the module for probability, but it's still bad enough with the conditional probability and conditional independence.

The crux of the lecture lies in constructing a Bayesian network. Using the different conditional probability given, we have to determine which variables are dependent to each other and which are independent and which are conditional independent. From this way, we can effectively reduce the space needed to keep the probability of the different variables by breaking them up into different tables and not all store on one table.


Software Engineering ---
After implementing, it's time to do testing for the system. So to keep things simple, we won't want to exhaustively test all the different cases for the system, therefore we select values that will test the limits of the system.

The meaning of testing the system is to try to break the system. If we manage to break the system, then we will need to debug and fix this problem. Therefore values that we want to choose are the values at the boundary.