Courses/Computer Science/CPSC 203/CPSC 203 2008Winter L03/CPSC 203 2008Winter L03 Lectures/Lecture 20

From wiki.ucalgary.ca
Jump to: navigation, search
  • House Keeping
    • Final Exam: MondAY aPRIL 21ST, 12-2P.M., KN RED.
    • Text Readings -- Security Associated Topics. Chapter 7 (see pages in TEXT READINGS from last lecture: Know basic networking and security jargon (see Security Glossary below for capsule definitions, and TEXT for more more complete discussion)
    • Text Readings -- Problem Solving Associated Topics. Chapter 10. (see TEXT READINGS below: Know System Development/Program LifeCycle, Design Techniques and Building blocks for programming) )
    • NOTE: Tutorial 1 the week of March 31st will be devoted to TA's working with you on Group Projects, while Tutorial 2 will be devoted to Assignment 2.
    • Thursday Lecture this week: I will review Assignment 2 and prep for next week's group project presentations at end of lecture.
    • Group Project Presentations Begin Next Week -- schedule is at the top of: http://wiki.ucalgary.ca/page/Courses/Computer_Science/CPSC_203/CPSC_203_2008Winter_L03/CPSC_203_2008WinterL03_TermProjects



Lecture 20

Our final triad of lectures concern problem solving from various perspectives. In the last lecture, we took a high level look at the problem of Computer Security, and used a number of analogies from biology to build connections between concepts developing in computer science, and those already developed in biology. This is an example of "Reasoning By Analogy", and is one of several problem solving approaches we will examine this lecture.

Problem solving is fundamental to computer science, and at the heart of programming. However, problem-solving occurs in every area of life -- from trying to deal with large scale national policy issues to fine-tuning your favorite recipe. Problem solving often involves certain thought patterns: Abstraction and Analogy to whittle a problem to its essence, and make connections to possible solutions. It also involves a host of techniques -- we mention some common techniques in the glossary. However we will focus on only two: Top Down Design (and associated decision trees) and Counting Causes and Effects

We will focus on providing a few tools to help you in problem solving:

  • a few definitions related to problem-solving
  • an introduction to the notion of conditional probabilities


These tools will then be used to try and brainstorm a solution to the following problem: What are the keystone websites of the internet? (Note -- in biology a "keystone species" are those species that hold an ecosystem together -- so if something happens to those specific species, the ecosystem cannot recover).

Keystone Species Example:We will illustrate the keystone species in a simple graphic at: http://www.vtaide.com/png/foodchains.htm

then transfer our intuition over to the internet (i.e. reason by analogy).


OBJECTIVES:

  • You will be introduced to several problem solving approaches
  • You will be able to apply top-down-design to a problem and create a decision tree of sub-problems.
  • You will be able to work out the structure of an empirical problem by "counting causes and effects" (conditional probability)


Problem Solving Thought Processes

Two key thought processes go into problem solving:

Abstraction: Whittling away details of a problem, until its basic attributes are clear. For example, a dots-and-edges mathematical model of a real world situation whittles away all the details until all that is left are the basic objects (nodes) and their relationships (edges).

Reasoning by Analogy: Making connections between an existing problem in one field and a problem in another field (which may have been already solved in the second field). Reasoning by analogy allows us to 'borrow strength' from another field, and also requires abstraction to identify similarities across fields that may appear to differ in their lower level details (e.g. Internet Security vs Biological Epidemiology; "Keystone" Websites are like "Keystone Species" in Ecology). Closely related, is the notion of metaphor, in which two disparate things are united.



Problem Solving Glossary

  • Cause/Effect/Goals -- We have a basic model of causality where we understand that usually things that occur earlier in time, or upon which other things depend are "causes" and things that occur later in time, or are the consequences of dependencies are "effects". This basic intuitive model is often complicated by the notion of "goals" where some future outcome, causes us to take action in the present to realize the outcome.
  • Conditional probability (in terms of cause/effect). The Probability of an Effect B given that a prospective cause A has already happened. Usually written as P(B/A). Conditional probability in terms of causes/effects is a method of working out the "structure" of a problem, by noting which components of a system are interdependant. Once this knowledge is available specific techniques such as Top Down Design, Object Oriented Design, Prototyping can be applied.
  • Heuristics -- 'Rules of thumb; informal procedures'. Often not guaranteed a solution.
  • Algorithm -- A mechanical procedure. A series of steps (usually sequential) to solve a problem capable of being run on a 'universal computer'. Note -- the idea of a Turing Machine was to create a mechanical system that could determine if any particular algorithm would ever halt or not (i.e. be able to reach a solution). This is equivalent to saying, in math, could certain theorems ever be proven true?
  • Prototype -- Minimal Working Model - (e.g. a prototype car has only the parts you interact with, but no working parts). Prototyping often becomes part of a 'spiral development process' where we rapidly iterate through a series of prototypes, adding new features in each round. This approach allows one to rapidly try out a number of design alternatives, without putting much effort up front.
  • Top Down Design -- Breaking a problem down into nested components (see modularity). What results is usually a 'Decision Tree', which is much like the Attack Trees previously encountered.
  • Modularity -- Building systems out of components that can be treated internally as 'black boxes' and connect to other components through clear interfaces. Often used to reduce complexity in a system.
  • Interface -- what the user can see and interact with. Interfaces SHOULD BE easy, intuitive, versatile. Good Examples: Pencil, Doorknob. Bad Examples: Universal Remotes, Many software interfaces.
  • Object Oriented Design -- Object oriented design can be considered a complement to top-down design. Essentially in object oriented design you define (a) a series of objects, called 'classes' and (b) what the objects attributes are and what they can do (their 'data' and 'methods' respectively) and finally the relationship between objects (which includes their interfaces, i.e. what each object sees of the other when it interacts). If top-down-design leads to 'tree-like-networks', oject oriented design often leads to more complex networks.

Problem Solving Examples

  • Example 1: Decision Trees
  • Example 2: Calculating Conditional Probabilities from a table of causes and events.


Resources

Python Programming. An Introduction to Computer Science. By John Zelle. 2004.


TEXT READINGS

TIA 4th Edition. Chapter 10 pp: 440-463

TIA 3rd Edn. Chapter 10 pp: 418-441