Introduction
Download
1 / 36

Introduction - PowerPoint PPT Presentation


  • 77 Views
  • Uploaded on

Introduction. Peeking into Computer Science. Mandatory: Chapter 1 Optional: None. Reading Assignment. Problems & Solutions. Computer Science perspective. At the end of this section, you will be able to: Define a (computational) problem Understand the terms algorithm and program

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Introduction' - reidar


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Introduction

Introduction

Peeking into Computer Science


Reading assignment

Reading Assignment


Problems solutions
Problems & Solutions

Computer Science perspective


Objectives

At the end of this section, you will be able to:

  • Define a (computational) problem

  • Understand the terms algorithm and program

  • Start working with Microsoft Excel Spreadsheets

Objectives


Computer science

Computer Science


Problems

  • Any problem has input and output

    • Examples: laundry, cooking, building

  • The problem specifies what needs to be done

  • It specifies the relationship between input and output

  • The problem is not concerned with how

Problems


Example searching the web

Example: Searching the Web


Solution search engine

Solution: Search Engine


Programs

Programs


Web crawler algorithm

Web Crawler Algorithm


General purpose programs

General-Purpose Programs


Spreadsheets

  • Gird of cells programs

  • Cell = intersection of a column and row

  • Columns are referenced by letters

  • Rows are referenced by numbers

  • Example cell: B1 contains 124

Spreadsheets


Formulas

=C7*D7

Formulas


Functions

=SUM(E7:E9)

Functions



Divide and conquer
Divide and Conquer programs

The power to solve


Objectives1

At the end of this section, you will be able to: programs

  • Understand and use the Divide & Conquer technique

  • Apply Divide & Conquer to a spreadsheet example

Objectives


Divide conquer approach

  • Divide and Conquer: programs

  • Divide the problem into smaller easier to solve problems

  • Solve the sub-problems

  • Combine the sub-solutions

Divide & Conquer Approach


Divide conquer

Overview

Component 1

Component 2

Component n

Divide & Conquer


Divide conquer1

Overview

1

2

n

Divide & Conquer


Divide and conquer1

  • Making a table programs

  • Easier:

    • Make the legs

    • Make the top

    • Combine them

Divide and Conquer


Making a table

Table

Legs

Top

Making a Table


Making a table1

Table programs

Legs

Top

Making a Table


Design example
Design Example programs

Spreadsheets


The problem

  • I would like to move to a US state that: programs

    • Has a warm climate

    • Has a low crime rate

    • Is close to Ottawa

  • Dividing the problem:

    • Collect the avg high temperature per state

    • Collect homicide rates from US states

    • Measure the time it takes to drive from each state to Ottawa

The Problem


1 collecting avg high temperatures

  • www.netstate.com programs

  • Avg high temperature is recorded in Fahrenheit

  • Use Google calculator to convert to Celsius

  • Record the data in a spreadsheet

1. Collecting avg high temperatures


The spreadsheet
The spreadsheet programs


2 collecting homicide rates

2. Collecting Homicide Rates


The spreadsheet1
The spreadsheet programs


3 time to ottawa

  • This needs to be further divided into sub-problems: programs

    • Find a point in the state

    • Measure the distance from that point to Ottawa

  • For 2, we can simply use Google maps

  • For 1, the geographic center, the capital city, or something else?

  • We choose the capital city

3. Time to Ottawa



Google maps
Google Maps programs


The spreadsheet2
The Spreadsheet programs


Combining sub solutions

Combining Sub-Solutions


The spreadsheet3
The Spreadsheet factors based on preference


The solution
The Solution factors based on preference


ad