SUNY Geneseo Department of Computer Science


Experimentation

{Date}

CSci 141, Fall 2004
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Misc

Hand out Lab 2

Beware of pseudocode vs Java in lectures

Questions?

Mini-assignments: be prepared to answer or ask questions when you come to class

Reading Summary

Sections 4.1 - 4.7

How to design experiments

Use experiments to compare theory to reality

Designing experiment

Choose data analysis before starting experiment

Draw conclusion about whether experiment supported hypothesis, based on analysis

Controls and comparison to bio

[Looking for Proportionality between Measurements and Function]

Example Experiment

(Mini-assignment)

Recall the algorithm to draw a line n tiles long

    // In some subclass of Robot:
    drawLine( int n, Color c ) {
        for ( i = 0; i < n; i++ ) {
            this.paint( c )
            this.move()
        }
    }

We determined that this sends 2n robot messages to draw a line n tiles long

So actual implementations should run in time proportional to n, i.e., running times should be of the form

for some constant c

Do an experiment to test this idea

n Time

Const

3 1.5 0.5
6 3.033 0.51
12 6.237 0.52

Next

Logic and conditional statements

Read Sections 5.1 - 5.3


Next Lecture