Issuu on Google+

CSC2010 – Week 1

Berkay Aydin June 12, 2014 Lab 1


Contents ●

Introduction (Contact, Rules, Grading)

This week's content

Computer Science

Algorithm

Example problems –

Problem 1

Problem 2

Problem 3

Jun 12, 2014

CSC2010 - Lab 1

2


Introduction ●

Berkay Aydin (bear:kai I:dɪn) –

PhD student at Computer Science Department

My website - http://cs.gsu.edu/~baydin2/

Research Areas

Spatiotemporal Databases ● Information Retrieval ● Solar Data Mining I am from Turkey ●

Contact –

Email: <brky.aydin@gmail.com>

Ask any questions related to class

Jun 12, 2014

CSC2010 - Lab 1

3


Introduction ●

Simple Rules –

No cheating – this may result in failing ●

No disrespectful behaviour (I will ask you to leave classroom if you do one of the following) ●

Cussing

Sleeping in the classroom

Eating and drinking

Cell phones (airplane mode is acceptable or turn it off)

Coming late

No bargaining on grades ●

Read the policy before cheating <http://www2.gsu.edu/~wwwfhb/sec409.html>

Please talk to Mr Bhola for such

Homework assignments ●

Jun 12, 2014

Type them, this is a CS course CSC2010 - Lab 1

4


This Week's Course Material ●

Computer Science –

Systematic study of designing algorithms that underlie the acquisation, representation, processing, storage and accessing information ●

Information (bits, numbers, characters, text, image, audio, video, chemical components, genes)

Designing algorithms → Implementing them

Computer Science is 'interdisciplinary'

Tasks of Computer Scientists ●

Designing algorithms and studying the behavior of algorithms Creating programming languages for implementing the algorithms

Building machines to execute those algorithms

Programming using the algorithms

Jun 12, 2014

CSC2010 - Lab 1

5


This Week's Course Material ●

Algorithm –

Solution to a problem

Step by step procedure

List of well-defined instructions

Generally high-level description

Representation of Algorithms –

Text

List of instructions

Flowchart Cook Pasta

Cook Pasta ●

Jun 12, 2014

Buy pasta from supermarket, then boil water, add salt and put pasta inside boiling water. Cook for 11 minutes. Lastly serve.

Buy pasta

Boil water and add salt

Put pasta inside water

Cook for 11 minutes

Serve

CSC2010 - Lab 1

6


Exercise Problems WashHair2

WashHair1 1. Wet your hair

1. Wet your hair

2. Set washCount to 0

2. Lather

3. Repeat until washCount is 2

3. Rinse

1. Lather, rinse

4. Lather

2. Increment washCount

5. Rinse

4. End of washing hair

6. Stop here

Question 1 ●

Which one is better?

Why?

Jun 12, 2014

CSC2010 - Lab 1

7


Exercise Problems

Question 2 ●

Traveling salesman problem for 25 cities –

A traveling salesman

25 cities, given distances between them

All cities must be visited exactly once

Total traveling distance must be minimum

Solution (this is an algorithm actually) 1. List all possible ways (order – so PERMUTATION!) 2. Calculate distance for each of them 3. Sort all the distances 4. Give the minimum

What is the problem? –

Permutation is so expensive to calculate ●

25! = 25*24*23*22*...*3*2*1 = 1.551121 * 10 25

Is it feasible?

Why?

Jun 12, 2014

CSC2010 - Lab 1

8


Exercise Problems

Question 3 ●

DVD – 4.7 GB –

What is 4.7 GB? ●

4812.8 MB or 4928307.2 KB or 5046586572.8 Bytes

Give or take 5 Billion bytes

A character can be stored using 1 Byte

Suppose, in average, there are 1500 characters for each book page. In average, a book has 300 pages and it takes up 1 inches of space in a shelf.

If we wanted to store all the books in one DVD in only one shelf, how long that shelf would be?

Jun 12, 2014

CSC2010 - Lab 1

9


Exercise Problems ●

5 Billion characters

1500 characters in one page

So 5,000,000,000 / 1500 ~= 3333333 pages

Each 300 page takes 1 inch

~11111 inches

~308 yards

1 American football fields = 100 yards –

We would need a shelf, longer than 3 American football fields

Jun 12, 2014

CSC2010 - Lab 1

10


Other questions

Do not forget to submit your homework.

Do you want to access slides?

Jun 12, 2014

CSC2010 - Lab 1

11


Week1