Discrete Mathematics

An Open Introduction, 3rd edition

Fall 2023 Update! The book is now also available on Runestone Academy. Instructors using this free service can assign and auto-grade the embedded interactive exercises. It even connects to Canvas, Blackboard, and other Learning Management Systems. Check it out!

Discrete Mathematics: An Open Introduction is a free, open source textbook appropriate for a first or second year undergraduate course for math and computer science majors. The book is especially well-suited for courses that incorporate inquiry-based learning. Since Spring 2013, the book has been used as the primary textbook or a supplemental resource at more than 200 colleges and universities around the world (see the partial adoptions list). The text is endorsed by the American Institute of Mathematics' Open Textbook Initiative and is well reviewed on the Open Textbook Library.

This 3rd edition brings many improvements, including nearly 100 new exercises (including many interactive exercises providing instant feedback), a new section on trees in the graph theory chapter, and improved exposition throughout. Previous editions will continue to be available indefinitely. A few times a year, the text is updated with a new "printing" to correct errors. See the errata list for more information.

Online homework sets are available through Runestone Academy (free), Edfinity (inexpensive) or as WeBWorK sets from the author (the WeBWorK exercises are available in the Contrib folder of the OPL as well).

Please contact the author with feedback and suggestions, or if you are decide to use the book in a course you are teaching. You can also easily submit feedback about an error or typo by creating a GitHub issue.

Get the book

The entire book is available for free as an interactive online ebook. This should work well on all screen sizes, including smart phones, and work will with screen readers for visually impaired students. Hints and solutions to examples and exercises are hidden but easily revealed by clicking on their links. Some exercises also allow you to enter and check your work, so you can try multiple times without spoiling the answer.

For offline use, a free pdf version, suitable for reading on a tablet or computer, is available for download. This should be searchable and easy to navigate using embedded links. Hints and solutions (when available) can be accessed by clicking on the exercise number, and clicking on the number of the hint or solution will bring you back to the exercise.

If you prefer a physical copy, an inexpensive print version of the text is available on Amazon. This should be cheaper than printing the entire book and binding it yourself. Page numbers match the pdf version. There is also a cheap Kindle version available; it works great on Android tablets; unfortunately it seems the math does not render well on Amazon's e-ink readers.

PreTeXt (and LaTeX) source

The source files for this book are available on GitHub.

Instructor and student resources

There are a number of videos instructors have made for classes they taught using the book. Check out the playlists below. If you make videos or know of others, please share them.

If you are using the book in a class you are teaching, instructor resources are available by request. Just contact the author. You can also request WeBWorK homework sets if you have access to a WeBWorK server.

About the book

The text began as a set of lecture notes for the discrete mathematics course at the University of Northern Colorado. This course serves both as an introduction to topics in discrete math and as the "introduction to proofs" course for math majors. The course is usually taught with a large amount of student inquiry, and this text is written to help facilitate this. Originally designed to support future math teachers, the text has a friendly and informal tone, and puts an emphasis on understanding the included concepts, rather than simply memorizing procedures. The book has also been successfully used in courses catering to computer science students, who also benefit from the deeper understanding it promotes.

Four main topics are covered: counting, sequences, logic, and graph theory. Along the way, proofs are introduced, including proofs by contradiction, proofs by induction, and combinatorial proofs. An introductory chapter covering mathematical statements, sets, and functions helps students gain familiarity with the language of mathematics, and two additional topics (generating functions and number theory) are also included.

While the book began as a set of lecture notes, it now contains a number of features that should support its use as a primary textbook:

  • 473 exercises, including 275 with solutions and another 109 with hints. Exercises range from easy to quite involved, with many problems suitable for homework.
  • Investigate! activities throughout the text to support active, inquiry-based learning.
  • A full index and list of symbols.
  • Consistent and helpful page layout and formatting (i.e., examples are easy to identify, important definitions and theorems in boxes, etc.).

About the author

Oscar Levin is a professor at the University of Northern Colorado. He has taught mathematics and computer science at the college level for over 15 years and received multiple teaching awards. He received his Ph.D. in mathematical logic from the University of Connecticut in 2009.


Creative Commons License
Discrete Mathematics: An Open Introduction by Oscar Levin is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You are free to download, use, print, and even sell this work as you wish to. You can also modify the text as much as you like (create a custom edition for your students, for example), as long as you attribute the parts of the text you use to the author.

If you are interested in using parts of the book combined with another text with a similar but different license (GFDL, for example), please reach out to get permission to modify the license.