15.08.2013 Views

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

“Applets, Not Craplets tm ” (– ca. 1997)<br />

c○: Michael Kohlhase 14<br />

Thinking about a problem will involve thinking about the representations we want to use (after<br />

all, we want to work on the computer), which computations these representations support, and<br />

what constitutes a solutions to the problem.<br />

This will also give us a foundation to talk about the problem with our peers and clients. Enabling<br />

students to talk about CS problems like a computer scientist is another important learning goal<br />

of this course.<br />

We will now exemplify the process of “thinking about the problem” on our mazes example. It<br />

shows that there is quite a lot of work involved, before we write our first line of code. Of course,<br />

sometimes, explorative programming sometimes also helps understand the problem , but we would<br />

consider this as part of the thinking process.<br />

Thinking about the problem<br />

Idea: Randomly knock out walls until<br />

we get a good maze<br />

Think about a grid of rooms separated<br />

by walls.<br />

Each room can be given a name.<br />

Mathematical Formulation:<br />

a set of rooms: {a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p}<br />

Pairs of adjacent rooms that have an open wall between them.<br />

Example 3 For example, 〈a, b〉 and 〈g, k〉 are pairs.<br />

Abstractly speaking, this is a mathematical structure called a graph.<br />

c○: Michael Kohlhase 15<br />

Of course, the “thinking” process always starts with an idea of how to attack the problem. In our<br />

case, this is the idea of starting with a grid-like structure and knocking out walls, until we have a<br />

maze which meets our requirements.<br />

Note that we have already used our first representation of the problem in the drawing above: we<br />

have drawn a picture of a maze, which is of course not the maze itself.<br />

Definition 4 A representation is the realization of real or abstract persons, objects, circumstances,<br />

Events, or emotions in concrete symbols or models. This can be by diverse methods, e.g.<br />

visual, aural, or written; as three-dimensional model, or even by dance.<br />

10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!