ES2660: Wild Card #5 - Fishes and Fishbowls

Speak for 2 mins on observation of the fishbowl discussion."What makes the best sort of fish for a fishbowl discussion"==============================================================There are like different types of fishes, I will elaborate in 5 main fishes.->Clown fish    - Hide in anemonesPeople:     - Have a lot of things to say     -... [Read More]

GES1011: The evolution of a global city state

Recap- EIC's singapore founded in 1819/24- Permission to establish a factory first but then after that to have a treaty - Raffles "forced" the sultan to sign singapore to him- It might be a second founding on this island but there might be implication- Make up our mind about imperialism - We... [Read More]

ES2660 - OXFORD Panel Discussion "Deep Mind"

What is Deep Mind-> Company that focus on researching AI.What does it do?Purpose is to learn how to solve problems and advance scientific discoveryDeepmind been losing money... Talent = moneyWhy might it be worth US$400million to Google to buy it.“Google acquired DeepMind in 2014, because they were excited about the... [Read More]

CS2040s : Tutorial 3: BST

Q1Worst Time Case:n^4search all 4 casesImproved:iterate aiterate blist sumiterate cIterate dlist sumSearch for a possible 100O(n^2)Q2a)- Easiest: O(n) time and spaceWe do a inorder traversal, and put it in the linked list- Improved: Rotate right, till theres no left child if theres no left child, go to the right child and... [Read More]

CS2100: Tutorial 4

Q10x20110000beq $t0, $zero, exit000100| 01000| 00000| 0000000000000010opcode   RS(t0)   $zero    Immediateaddi, $s1, $1, 1001000| 10001| 10001| 000...0001opcode    $s1      $s1      Imme0x08100050For jump/ I format:We remove the last 2 bits for jump because all instructions ends with 00For only J format:and we remove 4 bits in front... [Read More]

CS2100: Pipelining

PipeliningMips PipeliningCan we go faster?Instruction Execution =Read contents from storage elemtsPerform computation through some combination logicWrite result to storage elementSingle-cycle processorPerformanceWe have to choose for the longest instruction time total as our cycle timeBut because we choose the longest, sometimes instruction will finish earlyTo execute 100 instruction = 100 *... [Read More]

CS2040s: Lab 3

B - TreesForm of balanced treeAnatomy of CPUALU does arithmeticCache linesDisk RamThe alu puts in cache lines,it will check the ram then if dont have it will check the disk and push backAfter the cache check the value it will stoer itIf alu wants the same value, it will go to... [Read More]

GEQ1000: Physics Reading

This reading is so boring that I want to die.The first part of the reading is about the history of the writer, Richard. The whole thing is just him wanting us to appreiat3e what we haveUncertainty of scienceNature of science and existence of doubt and uncertaintyIdeas are born every day... [Read More]

CS2040s: Hashing

HashingProblem: Find me a thief.Want to look through a database of criminals based on fingerprints. Each lookup should be very fast.We need to look for an ADT.Dictionary ADTOperation with k = key and v = valueBut it is not orderedImplementation using Data StructureInsert Time:Unordered Array/Linked List: O(1)Ordered Array/Linked List: O(n)Balance... [Read More]

ES2660: Presentation Question

Group B:Notes:- Following ennis that are easily digest1. pin point literal arguments2. Analysis the structure - the flow of the argument3. Check Credibility- Check if its ok4. Infer and Deduce- Check credibility of author and draw hypothesis- Check underlying message and persuasion- Prefer and induce- Use level 6 (if and only... [Read More]

CS2100: Tutorial 3

Tutorial 3Q1a)Load Upper immediate (LUI) $t0, 0xFFOR $s0, $s0 , $t0We load upper immediate because we cannot apply ori on the first 16 bits. Ori is i format and only takes 16 bits but the one we want is 32 bits.b)XORI $s0, $s0, 0xFF00If its different, its true if its the... [Read More]

CS2100: Processor - Control

ControlControl unitWe will have the control unit that is plug into all the components mention in the previous slides (MUX/REGISTERS/DATAMEMORY)This will allow us to control when we want each component to accept each specific dataControl SignalsRegDstControls the multiplexer.False (0) - Write register = Inst[20:16] //Register TargetTrue (1) - Write register... [Read More]

CS2040s: DG 3

Recap:Each Node can be a parent node and always have 2 child node.Normal BST:If we insert and its not balancing, we will have to travel O(n) time.This is an issue thus there exist an avl tree.AVL tree will balance for us so searching is O(logn) time.AVL Tree:Imagine we are plucking... [Read More]

CS2100: Processor - Data Path

Data PathDatapath- Collection of Components that transform data (Arithmetic/logical/memory)Control- Tells datapath,memory, I/O devices and tells them what to do base on instructionsImplementationInstruction Execution Cycles- FetchBring the instruction from memory.We need the PC/ Storage (IR) to hold the address- DecodeWe have a 32 bits 1 and 0sDecode to find out what... [Read More]

CS2040s: Lecture 8 - Balanced Binary Search Tree (AVL)

Balanced Binary Search Tree (AVL)AVL TREESPerfectly Balance, as all things should be.Previously, when look at normal BST, if it is imbalance, its o(n). But if it is balance,ie. h= logn always => O(logn)1. Keep a height variable at each nodeo.height = max(o.left.height, o.right.height) + 1 2.Maintain the variant: All nodes in... [Read More]

CS2040s: BST

Binary Search TreeIs an ordered dictionary ADT.Operations with k = key, v = value: insert(k, v):inserts an element with value v and key ksearch(k): returns the value with key kdelete(k): deletes the element with key kcontains(k): true if the dictionary contains an element with key kfloor(k): returns next key ≤ kceiling(k):... [Read More]

GES1011: Lecture 5 - Colonial Remaking by British

Colonialism /ImperialismEuropeans have been dominating silk roads to dominate the spice trade and was willing to wage wars. The Dutch were dominant.There was a difference between the ottomans and the other european power. The ottomans are quite dominate but they are more dominant in the mediterranean sea. Presence in the regionThe... [Read More]

GES1011: Lecture 4 - Exploration and emptiness

Recap:The historical difference between turnbull and Miksic.- Difference in opinions and theories- Difference in time framing in when events happen"What happen between the 14th century and 1819"Singapura's nodal trading polity in 14th century is following the regional legacu of Funan and SrivijiyaBut its not as dominant as those and only... [Read More]

CS2040s: Tutorial 2

c)/d)1. Select pivot2. Partition3. Get index of pivot in new partition (i)4. If smaller k, loop to left, else right5. Partition again and repeat6. Stop when i = kThis is O(n) in averageIs a summation = n + n/2 + n/4 + ... n/2^kBecause we are only doing one side... [Read More]

CS2100: Tutorial 2

Tutorial 11.int readArray(int arr[], int limit){      int input = 0;    for(int i = 0 ;i < limit ; i++){     scanf("%d", &input );    if(input> = 0)     arr[i] = input;     else     break;    }}void reverseArray(int arr[], int size){    int temp , i ,... [Read More]