100 likes | 113 Vues
Teaching Mathematical Reasoning Across the Curriculum Discrete Math. Joseph E. Hollingsworth Indiana University Southeast Computer Science Department jholly@ius.edu This research is funded in part by NSF Grant DUE-1022191. Reasoning Across the Curriculum. Question
E N D
Teaching Mathematical Reasoning Across the CurriculumDiscrete Math Joseph E. Hollingsworth Indiana University Southeast Computer Science Department jholly@ius.edu This research is funded in part by NSF Grant DUE-1022191
Reasoning Across the Curriculum Question • Can we explicitly connect discrete math topics with reasoning about software correctness?
Examining CS2013 Strawman Draft • KA:Discrete Structures (DS/Proof Techniques) • Core-Tier1 Topic:Induction over natural numbers • Learning Outcomes: • Outline the basic structure of each proof technique described in this unit. [Application] • Apply each of the proof techniques correctly in the construction of a sound argument. [Application] • Level of Mastery:Knowledge, Application, Mastery
Unsatisfying for CS Undergrad Core-Tier1 Topic: Induction over natural numbers Prove using induction:
1st Some Comments • I am not the first to say what appears next. • What appears next can be done. • It’s not impossible. • Is meant to be a CS2013 “Knowledge” topic in a discrete math class.
Goal: Connect Induction with Reasoning About Software Correctness • Example: Compute the sum of two integers (not the summation from above) intsum(int j, int k) // requires j >= 0 // ensures result = j + k { if (j == 0) { return k; } else { j--; int r = sum(j, k); return r + 1; } }
Base Case intsum(int j, int k) // requires j >= 0 // ensures result = j + k { if (j == 0) { return k; // Assume: (j = 0) ^ (result = k) // Confirm ensures: result = 0 + k } else { ... } }
Inductive Assumption int sum(int j, int k) // requires j >= 0 // ensures result = j + k { if (j == 0) { ... } else { j--; int r = sum(j, k); return r + 1; // Assume: r = (j – 1) + k } }
Induction Step int sum(int j, int k) // requires j >= 0 // ensures result = j + k { if (j == 0) { ... } else { j--; int r = sum(j, k); return r + 1; // Assume: (r = (j – 1) + k) ^ (result = r + 1) // Confirm ensures: result = j + k } }
Final Comments Question: • What about connecting induction to reasoning about correctness of software at the CC2013 “Application” level? Answer: • The example above was at the “Knowledge” level, i.e., where we show students the connection. • In later courses, e.g., data structures or analysis of algorithms, move to the “Application” level for induction on software. Reference: • Long, T.J., Weide, B.W., Bucci, P., and Sitaraman, M.,"Client View First: An Exodus From Implementation-Biased Teaching," Proceedings 30th SIGCSE Technical Symposium on Computer Science Education, ACM, March 1999, 136-140.