DeepAI AI Chat
Log In Sign Up

Discrete Math with Programming: A Principled Approach

by   Yanhong A. Liu, et al.

Discrete mathematics is the foundation of computer science. It focuses on concepts and reasoning methods that are studied using math notations. It has long been argued that discrete math is better taught with programming, which takes concepts and computing methods and turns them into executable programs. What has been lacking is a principled approach that supports all central concepts of discrete math – especially predicate logic – and that directly and precisely connects math notations with executable programs. This paper introduces such an approach. It is based on the use of a powerful language that extends the Python programming language with proper logic quantification ("for all" and "exists some"), as well as declarative set comprehension (also known as set builder) and aggregation (e.g., sum and product). Math and logical statements can be expressed precisely at a high level and be executed directly on a computer, encouraging declarative programming together with algorithmic programming. We describe the approach, detailed examples, experience in using it, and the lessons learned.


page 1

page 2

page 3

page 4


Conceptual Mathematics via Literate Programming

Recent developments in computer programming and in mathematics suggest t...

A Bridge Anchored on Both Sides: Formal Deduction in Introductory CS, and Code Proofs in Discrete Math

There is a sharp disconnect between the programming and mathematical por...

Cons-free Programs and Complexity Classes between LOGSPACE and PTIME

Programming language concepts are used to give some new perspectives on ...

An Online Development Environment for Answer Set Programming

Recent progress in logic programming (e.g., the development of the Answe...

Introducing Computer Science to High School Students through Logic Programming

This paper investigates how high school students in an introductory comp...

An Experience of Introducing Primary School Children to Programming using Ozobots

Algorithmic thinking is a central concept in the context of computationa...

Predicate Invention by Learning From Failures

Discovering novel high-level concepts is one of the most important steps...