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.

Tuesday 25 March 2008

Lecture Review Week 9

Database --- This week's lecture was rather difficult to understand. What in the world is relational algebra.. Weren't algebra supposed to be some letter that represent numbers?

Anyhow, there are eight operations in relational algebra. Selection, projection, union, intersection, difference, cartesian product, natural join and renaming operator.

Projection is equivalent to the selection clause in SQL. As there could be duplicate tuples, the rows with duplicate are removed - Distinct. Projection is represented by PI (R)

Selection correspond to the Where clause. Since it always selects the whole tuple, all the tuples are distinct, thus there won't be a need for distinct keyword. Selection is represented by SIGMA(R).

Union is the combined of the different relations, removing duplicate tuple. Intersection is the duplicate tuples in the relations being considered. Set difference is the tuples that appear in the first relation but not in the second relation.

Cartesian product gives all the possible combination of the tuples between the first and the second relation. No duplicate is possible. Theta-join does a cartesian product of the two relations on some conditions given.

Natural join joins two relations with relations of the same name and projects only one of the attribute. Renaming allows attributes to be renamed, similar to the keyword -As in SQL.


Business Law --- The first lecture on Company Law. First off, the 3 types of business was introduced - Sole-proprietorship, partnership (up to 19 partners), and company (more than 19).

A company is a legal person but do not have the senses like a natural person. The two primary organs of a company are the board of directors and shareholders. The directors are people who run the company in accordance to the Companies Act. The qualification of a director is just that you have to be above 21 years old and is a natural person.


Business Correspondence ---
The second Oral Presentation lecture focuses on making the talk a memorable one for the audience. Visual aids must be attractive, and must not be filled with lines and lines of words. Everything should be written in point form.

Contents must be audience centred, difficult to understand terms and abbreviations must be explained.

Use catchy phrases with memory devices and word painting techniques. Give your points in words that give the same sound - alliteration. Repeats your catchy phrase to make an impression. Make comparison using simile, metaphor. Other techniques include allusion, counterpoint, hypothesis and rhetorical question


Artificial Intelligence --- The lecture continues on Logics. To infer from first order logic, there are three ways, forward chaining, backward chaining, and resolution. Basically, I still don't understand forward and backward chaining. For resolution, it is trying to form a proof by refutation / contradiction. By adding the negation of the statement to be proven to the knowledge base, you try to derive that the statement is unsatisfiable. This will therefore prove that the statement is true.


Software Engineering --- This week's lecture basically converts state diagrams into codes and see what should be done to enforce that the states are not violated. Converting from designs to codes are usually quite intuitive and nothing much can be said about this lecture. Anyway, the test is done after the mid-term test, and I really can't concentrate well thereafter. Just hope the test is not too badly done like the other two modules.

Tuesday 18 March 2008

Lecture Review Week 8

Database --- This week's lecture continued from the lecture in week 6 - domain calculus. It's quite like tuple calculus, but this deals with the columns. It takes the form of

{ <> | 3y relation(x,y)}

All variables in <> are free variables. All others are not, and they need to be quantified by an existential or universal quantifier.


Business Law --- This week is on Product Liability. It's sort of an extension of tort of negligence and and sales of goods. You will have to proof the 4 essences of negligence. There are two ways for the remedies for this. First is under negligence, the second is under a breach of contract.


Business Correspondence --- This was a fun lecture, the first for oral presentation. There are five steps in the oral presentation process. This lecture concentrated on the first three.

First, is to analyze the audience and prepare the presentation in accordance to the audience you have. Try to give the presentation in a way that will benefit the audience and things that they will be interested in. The venue and time of the presentation is also important to take into account.

Second, apply ABC. Analyze the topic, Brainstorm content ideas, Choose your information. While brainstorming, don't judge the ideas that come up, jot everything down.

Third, draft your speech. The introduction must be captivating and motivating. Get the audience attention right from the start. Use transitional phrases to order the points, have mini-summaries to stress the main points, and double mini-summaries to do transitions between speakers. Conclusion is to summarize the whole presentation. Use the same phrasing as it was used in the blueprint during introduction. Any pamphlet you wish to hand out should be done at the end of the conclusion so as not to distract the audience by letting them read the pamphlet during your presentation.


Artificial Intelligence --- One hour test which I mostly couldn't do, just as I expected. After which a short lecture to wrap up first-order logics.


Software Engineering --- It's the first lecture by the second lecturer. This week focus was on defensive programming, which simply means maintaining the constraints that you have set up during the design phase. Things like 1-1, 1-*, 0..1-*, should be enforced during the coding. It's quite intuitive to know which part of the program to start working from.

Thursday 6 March 2008

Lecture Review Week 7

Database --- Two tests in 2 hours, it's been fun.

Business Law --- It's a new topic on tort of negligence, and the tutorial question that my group will have to present is on this topic. Don't really understand the lecture much, but after reading up on the topic, this is what I think the topic is about.

To prove that someone was negligent to you, you have to show that the person owes you a duty of care. For example, when you walk on the street, you have to be careful not to walk into them, causing them injuries. While the standard of care may differs in different cases, the reasonable man test still applies for all of them, just that the man will be specialist of that particular profession that is undergoing the trial.

Apart from the duty of care, the negligence must have caused damage to the other party. This cause will also be accessed based on whether the damage is foreseeable and not too remote or far-fetched.

For defenses against negligent, there are two ways mentioned. First is that the injured party had volunteered to the risk or that he had consented the risk he is undertaking. This is a complete defense. Another is that the injured party was partly to blame for his own injury, therefore the injured party can only claimed part of the damages that the defendant is responsible for.


Business Correspondence --- The lecture was quite interesting and is on inter-cultural communication. This lecture wasn't to be tested in the exam but was still good to have.

As the topic has suggested, it's about understanding how the different cultures are like and that things that we do, other cultures will do it differently. When talking to my superior, I'll try to keep eye contact but some other culture may not as this is a sign of respect. There are just too many examples, so I shan't go into details.


Artificial Intelligence --- This lecture is on first-order logic, and it was mostly covered before in previous semesters. The AND, OR, NOT, =>, <=> and so on. But there's one part that I don't really understand is the sign '|=' which represents entail. When it's said that a knowledge base entails a statement says P i.e.

K.B. |= P,

it means that the K.B. is actually a subset of the statement P. At first, I thought that it was the other way round, but now, i think it does makes sense. The entails is saying that the statement P is implied from the knowledge base through some logics, so it's quite intuitive that P should be a bigger set or the set K.B.


Software Engineering --- This lecture is the last lecture by the first lecturer, and it concludes the design part of the module. How do we draw a state-chart? Actually, you just have to imagine in your mind how the software will work, and what the different states will be will automatically come to you. Then from this states, you go through the different ways that the state may change and draw the arrow out. Then there you have it, the state-chart.

Monday 25 February 2008

Lecture Review Week 6

Database --- This lecture is like a revision from the pre-requisite module. The truth is what you see inside the database, and not what is true in the real world. Things that don't make sense may be true, so don't use your knowledge to determine whether a statement is true.

Business Law --- This is on the sale of goods act. It's a contract to shift ownership of personal belongings from seller to buyer after the buyer paid money to the seller. Goods can be classified into three types - Specific goods where the very goods to be sold is confirmed at time when the contract is made. Unascertained goods where the goods to be sold is out of a bulk amount and not yet confirmed exactly which item in the bulk is to be sold. Future goods are goods that are not yet available at time when contract is made.

The ownership passes with the intention of the two parties in specific goods and for unascertained goods when they are ascertained. Once ownership is passed, the risk is also passed at the same time, meaning whatever that happens to the goods thereafter will be borne by the buyer. If the intent was not shown when the contract is made, the ownership passing will depends on the five rules listed in s18.

Business Communication --- Step 5 - step 8 of proposal writing is the actual part of writing the proposal. Step 5 is to organise the information you wish to present in a systematic way. Step 6 is to write your first draft, Step 7 to KISS (keep it short & simple) the reader and step 8 is to create visual impact to attract the reader's attention. This can be done by using a good font and formating of the document.

Artificial Intelligence --- To continue with more searching, this lecture goes on to constraint satisfaction problem. The most common question for this type of problem is the map colouring, which asks what is the least number of colours that you need to use to colour the whole map, and no two neighbouring states can have the same colour. This question can be easily represented in the form of a constraint graph.

Of course, when you choose which state to start colouring from, you will have to check for the state with the most constraints, in the graph representation will be the node with the highest degree.

You can also use other method like forward checking to check in advance the consequence of colouring the state. This is done by keeping track of the remaining legal value of unassigned nodes, if there is a state that will have no legal value, then it would signify a bad move.

Arc consistency is the chain reaction from making an assignment. When you remove a value from a state because the value is impossible, then it could cause other states to have other removal of their possible values.

Software Engineering --- Continuing into the design for the software, more notations are added to the domain modeling and use-case. Then there's something called the interaction diagram, which shows how the user will interact with the software. Sort of resembles a time-line, showing the different activities that take place when the user use the software.

Friday 15 February 2008

Lecture Review Week 5

Database --- This lecture covers conceptual modeling. It's more diagrams than words showing relationships between entities


Business Law --- The conclusion of contract laws this week covers the discharge from contracts. This is done in 4 ways. Firstly, when the contract is completed exactly and precisely, you are automatically discharged from the contract. It's 'ALL OR NOTHING', unless it's a divisible contract that states when you completed the contract to certain extent, you get paid partially.

Second way is ending the contract by agreement. Third way is by frustration, where neither party is at fault that the contract cannot be completed. In this case, the deposit must be refunded, no more outstanding sum of money will be payable but you can be paid for the expanses made so far till the point when there is a frustration.

The fourth way is by breaching the contract. Of course, this means there's a case. You can be sued for damages for breaching, but the amount of damages must be kept as low as possible for the wrong-doer. Damages is not profit, but a form of compensation. If damages is not enough, then Specific Performance may be used to make up for the inadequency.


Business Communication --- Proposal is an offer to furnish goods and services, research a subject, or to provide a solution to a problem. They can be divided into four types, solicited internal, usually requested by your boss to provide a solution to a problem, unsolicited internal, which you initiate to offer a solution to your boss (bootlicking?!), solicited external and unsolicited external.

Proposal writing can be divided into eight steps.
Step 1) Analyze RFP, Request for Proposal. Content requirement that gives technical function requirement, legal requirement which states terms and conditions, ownership of work, administration information which gives point of contacts, due date and how many copies of the proposal required, format guideline which states the language, font, page layout for the proposal.

Step2) Do research, understand the problem and needs of the public through market research. Do product research by coming out with viable solutions to the problem. Client research writing a targetted proposal.

Step3) Design a prototype,

Step4) Focus the proposal, arouse the interest of the reader


Artificial Intelligence --- One more searching technique introduced. This will be used in the the first project for the module. I wonder why people already finished this project even before this lecture.. Alpha-Beta pruning is a technique that that searches for a highest 'Minimax' value from the different states possible. The idea here is to assume the opponent is optimal, thus you can omit some paths which you know will lead to a worse state. However, if the opponent is noob, and will not choose his optimal path, then this technique may not be optimal.

This pruning depends alot on the order of expansion of nodes, sometimes, there may not be pruning at all.


Software Engineering --- Wow, this lecture basically just expand the Use-case Diagram and Domain Model to contain more detail planning. This will be the design for the software that you are going to build.