프로그래밍을 활용한 이산수학: 체계적 접근법
Discrete Math with Programming: A Principled Approach
Discrete Math with Programming: A Principled Approach
@misc{liu2020discrete,
title = {Discrete Math with Programming: A Principled Approach},
author = {Yanhong A. Liu and Matthew Castelllana},
year = {2020},
eprint = {2011.14059},
archivePrefix = {arXiv},
primaryClass = {cs.CY},
url = {https://arxiv.org/abs/2011.14059}
}
Liu, Y. A., & Castelllana, M. (2020). Discrete Math with Programming: A Principled Approach [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2011.14059
LIU YA, CASTELLLANA M. Discrete Math with Programming: A Principled Approach[EB/OL]. (2020-11-28)[2026-11-29]. https://arxiv.org/abs/2011.14059.
초록
이산수학은 컴퓨터 과학의 기초를 이룬다. 이산수학은 수학 기호를 사용하여 연구되는 개념과 추론 방법을 중심으로 한다. 오랫동안 이산수학을 프로그래밍을 통해 가르치는 것이 더 효과적이라고 주장되어 왔으며, 이는 개념과 계산 방법을 실행 가능한 프로그램으로 변환하는 과정이다. 그러나 아직 이산수학의 모든 핵심 개념, 특히 명제 논리를 지원하며 수학 기호와 실행 가능한 프로그램을 직접적이고 정확하게 연결하는 체계적인 접근법이 결여되어 있었다. 본 논문은 이러한 접근법을 소개한다. 이 접근법은 파이썬 프로그래밍 언어를 적절한 논리 양화 ("모든"과 "존재하는 어떤") 과 선언적 집합 이해 (집합 생성자) 및 합집합 (예: 합과 곱) 을 포함하도록 확장한 강력한 언어를 기반으로 한다. 수학 및 논리적 명제는 높은 수준에서 정확하게 표현되어 컴퓨터에서 직접 실행될 수 있으며, 이는 선언적 프로그래밍과 알고리즘적 프로그래밍의 통합을 장려한다. 본 논문에서는 해당 접근법, 상세한 예시, 사용 경험 및 얻은 교훈을 기술한다.
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.