CS146 Overview. Problem Solving by Computing Human Level Virtual Machine Actual Computer Virtual...

14
CS146 Overview
  • date post

    22-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    1

Transcript of CS146 Overview. Problem Solving by Computing Human Level Virtual Machine Actual Computer Virtual...

Page 1: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

CS146 Overview

Page 2: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Problem Solving by Computing

Human Level

Virtual Machine

Actual Computer

Virtual Machine Level L0

Page 3: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Languages, Levels, Virtual Machines

A multilevel machine

Page 4: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Languages, Levels, Virtual Machines

Page 5: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Problem Solving by Computing

Human Level

(Algorithms)

Machine Level Ln

(JAVA )

Page 6: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

What is an Algorithm?

An algorithm is a well-defined computational procedure that takes some value or set of values, as input and produce some value or set of values as output.

A “tool” for solving a well-specified computational problem

Page 7: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Sorting Problem

Input: A sequence of numbers (a1, a2, . . .)

Output: A reording (a’1, a’2, . . .) of the input such that a’1 a’2 . . .

Page 8: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Simple Sorting Algorithms

1. Insertion Sort

2. Merge Sort

3. Quick Sort

Page 9: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Simple Sorting Algorithms

1. Insertion Sort

2. Merge Sort

3. Quick Sort

Page 10: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Insertion Sort

j 2 to length[A]

Do A[j] key

insert A[j] into A[1, 2, … j-1]

i j-1

While i > 0 and A[I]> key

Do A[i+1] A[i]

i i-1

A[i+1] key

Page 11: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

5 2 4 6 1 3

j=2

2

i=j-1=1 Key=2

A[1]>key 1>0

5 2

Page 12: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Latent Semantic Index

Project:

Compute the LSI (Latent Semantic Index) of a set of web pages/text files, such as Google’s return.

Sort a web page or a text file (XML or Text) in alphabetical order

Page 13: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Latent Semantic Index

1. Sort a web page or a text file (XML or Text)

2. Create an Inverted file

Attached to each words a list of locations that this word has appeared

Page 14: CS146 Overview. Problem Solving by Computing Human Level  Virtual Machine   Actual Computer Virtual Machine Level L0.

Latent Semantic Index

1. Applications

2. Use LSI, we can cluster (classify) the return of Google’s search into meaningful group