Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Discrete Math in Computer Science

Discrete Math in Computer Science

Ratings: (0)|Views: 18|Likes:
Published by api-3749303

More info:

Published by: api-3749303 on Oct 17, 2008
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Discrete Math in Computer Science
Ken Bogart
Dept. of Mathematics
Dartmouth College

Cli\ufb00 Stein
Dept. of Computer Science
Dartmouth College

June 23, 2002

This is a working draft of a textbook for a discrete mathematics course. This course is designed to be taken by computer science students. The prerequisites are \ufb01rst semester calculus (Math 3) and the introductory computer science course (CS 5). The class is meant to be taken concurrently with or after the second computer science course, Data Structures and Computer Programming (CS 15). This class is a prerequite to Algorithms (CS 25) and it is recommended that it be taken before all CS courses other than 5 and 15.

\ue000Copyright Kenneth P. Bogart and Cli\ufb00 Stein 2002
Chapter 1
1.1 Basic Counting
About the course

In these notes, student activities alternate with explanations and extensions of the point of the activities. The best way to use these notes is to try to master the student activity before beginning the explanation that follows. The activities are largely meant to be done in groups in class; thus for activities done out of class we recommend trying to form a group of students to work together. The reason that the class and these notes are designed in this way is to help students develop their own habits of mathematical thought. There is considerable evidence that students who are actively discovering what they are learning remember it far longer and are more likely to be able to use it out of the context in which it was learned. Students are much more likely to ask questions until they understand a subject when they are working in a small group with peers rather than in a larger class with an instructor. There is also evidence that explaining ideas to someone else helps us organize these ideas in our own minds. However, di\ufb00erent people learn di\ufb00erently. Also the amount of material in discrete mathematics that is desirable for computer science students to learn is much more than can be covered in an academic term if all learning is to be done through small group interaction. For these reasons about half of each section of these notes is devoted to student activities, and half to explanation and extension of the lessons of these activities.

Analyzing loops

1.1-1 The loop below is part of an implementation of selection sort to sort a list of items chosen from an ordered set (numbers, alphabet characters, words, etc.) into increasing order.

fori= 1 ton
forj= i+1 ton
if(A(i)> A(j))
exchangeA(i) andA(j)

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->