340 likes | 369 Views
Explore examples of integrating mathematical thinking into computer science curricula, emphasizing connections between math and CS, including functional programming, WeBWorK, and more. Learn how this approach enhances problem-solving and critical thinking skills.
E N D
Integrating Mathematical Thinking into the Curriculum:Examples Dr. Christelle Scharff cscharff@pace.edu Assistant Professor Computer Science Department New York Presentation FRN NYU, June 2004
Outline • Introduction • Three examples • The Thinking through Computing Learning Community • Functional Programming in a Discrete Mathematics Course • WeBWorK for Discrete Mathematics • Workshop: Practice with WeBWorK
Integrating Mathematical Thinking into CS Curricula • Group created by D. Baldwin and P. Henderson in 1999 • Mathematical Thinking: “Applying mathematical techniques, concepts and processes, either explicitly or implicitly, in the solution of problems -- in other words, mathematical modes of thought that help us to solve problems in any domain. In its most general interpretation, every problem-solving activity requires mathematical thinking. For example, basic logic, be it used explicitly or implicitly is required for all problem-solving activities.” • http://cs.geneseo.edu/~baldwin/math-thinking
Highlighting the Connections between Maths and CS • Creation of a repository for instructors (and students) showing the connections between Maths and CS • Examples of connections: Pre- and post-conditions, invariants, recursion, symbolic computations, relational algebra, formal specification and verification… • http://blue.butler.edu/~phenders/iticse2002
Hackers Know Logic! • “SQL Injection is a technique which enables an attacker to execute unauthorized SQL commands by taking advantage of unsanitized input opportunities in Web applications building dynamic SQL queries” • SELECT * FROM users WHERE username = ‘bob' and PASSWORD =‘bobpassword' • SELECT * FROM users WHERE username = ‘bob' and PASSWORD = ‘x’ or 1 = 1 • Try it at: http://www.csis.pace.edu/~scharff/sqlinjection
Pace University and Mathematical Thinking • CAFME (Center for the Advancement of Formal Methods in Education) • Use of Z in diverse undergraduate and graduate courses • Master in Software Design and Development • Software Validation and Verification • Mathematical Modeling of Software Artifacts
The Thinking Through Computing Learning Community Pace University Fall 2002
Learning Communities • LCs: “Classes that are linked or clustered during an academic term, often around an interdisciplinary theme, and enroll a common cohort of students” • LCs as a way of solving problems linked with academic achievements and retention, and as models to import and export knowledge from one course to another • Interests of LCs for students: • Deeper understanding of materials by making connections • Learn to find similarities in disparate subject areas • Experience increased interaction with students and faculty • Participate in active and collaborative learning • Explore diverse perspectives • Interests of LCs for faculty • http://learningcommons.evergreen.edu
Courses and Connections • CIS 101: Introductory computing course for freshmen non-CS majors • Problem solving, algorithms, programming in Visual Basic, computer organization, data representation, networking, Excel, HTML, ethical issues in computing • PHI 253: Propositional Logic • Translate sentences from/to English to/from propositions, truth tables, formal proofs • Connections • Rigor in formal proofs and in programming • Transformation of English sentences to propositions, and then to Visual Basic statements • Truth tables in Excel • Advanced search in Google
Assignments • Programming in Visual Basic: The “Learn how to do truth tables” application that determines whether the user could construct truth tables for the OR, AND, IMPLIES and BICONDITIONAL connectives • Writing an essay on social and ethical issues in computing • Designing an E-portfolio using HTML • Autobiographical presentation , LC description, reflective logs, links to students’ work…
Functional Programming and Discrete Mathematics SUNY Stony Brook Fall 2000 and Spring 2001
SUNY Stony Brook Curriculum • ACM Computing Curriculum 2001 http://www.acm.org/sigcse/cc2001 • Sequence of courses: Discrete Structure 1 Programming 1 Discrete Structure 2 Programming 2 • Curriculum originally designed by Dr. Peter Henderson • Use of SML in Discrete Structure 1 Prerequisite
Discrete Structure 1 • Propositional logic • Number theory • Set theory • Functions • Recursion • SML (Standard Meta Language) • http://www.smlnj.org/ and SML .NET • Induction • Automata • (Trees • Graphs)
Use of SML • Students do not have programming experience • It is not a programming class. SML is introduced as a tool. • Why SML? • Non verbose syntax • Quick start • Subset of SML • Types and inference of types • Function definitions • Pattern matching • Higher order functions • Polymorphism
Factorial fun fact(n) = if n = 0 then 1 else n * fact(n-1); Without Pattern Matching With Pattern Matching fun fact(0) = 1 | fact(n) = n * fact(n-1);
The reverse of a list Without Pattern Matching With Pattern Matching
Interests • Encourage mathematical thinking early in the curriculum • Convince students that the mathematics in discrete structures are relevant to their careers • Introduction to problem solving • Introduction to prototyping • Introduction to testing • Introduction to formal specification • Understanding of recursion
WeBWorK: An environment to Deliver Web-based Homeworks and More SUNY Stony Brook Spring 2001 Pace University Fall 2001 and after
What is WeBWorK? • More than an environment to deliver homeworks to students • Developed at the University of Rochester • Freely available to educational institutions • Mainly used in mathematics (algebra, calculus) and physics • Used by more than 50 institutions around the country including Columbia, Harvard, Stony Brook, Pace… • WeBWorK is extensible • http://webwork.math.rochester.edu
WeBWorK for Students • Easy of access (Internet) • Immediate feedback as to whether the answer is correct or not • Individualized version of the problems for each student • Each homework can be printed • Every problem has a Feedback button which sends an e-mail message directly to the instructor
The WeBWorK Professor • Management of the course • List of students, passwords • Add and remove students • Monitor the progress of the students • Create and manage an exam • Create and deliver homeworks • Starting date, due date • Automated grading • Automated delivery of the solution
Problem Sets • Create problem sets with solutions • Written in PG (Problem Generating) • Perl, html, latex • Individualized version of the problems for each student • Questions: matching, multiple-choice… • “Ask the question you should rather than the questions you can”
Use of WeBWorK • More than 1000 students used WeBWorK at SUNY Stony Brook in a Discrete Mathematics course • Problems on number theory, set theory, function, recursion and SML • WeBWorK is interfaced with Oliver to deliver propositional logic problems • http://www.csis.pace.edu/~scharff/SOFTWARE/OLIVER/oliver.html • 70 students used WeBWorK at Pace University for Functional Programming and Logic Programming problems, and in the Thinking Through Computing LC
Question 1 – Source code # A question requiring a string answer. $string = 'world'; BEGIN_TEXT Complete the sentence: $BR \{ ans_rule(20) \} $string; $PAR END_TEXT ANS( str_cmp( "Hello") );
Question 2 – Source code # A question requiring a numerical answer. #define the variables $a=random(1,9,1); $b=random(2,9,1); BEGIN_TEXT Enter the sum of these two numbers: $BR \($a + $b = \) \{ans_rule(10) \} $PAR END_TEXT $sum = $a + $b; ANS( num_cmp( $sum ) );
Question 3 – Source code # A question requiring an expression as an answer BEGIN_TEXT Enter the derivative of \[ f(x) = x^{$b} \] $BR \(f '(x) = \) \{ ans_rule(30) \} $PAR END_TEXT $new_exponent = $b-1; $ans2 = "$b*x^($new_exponent)"; ANS( fun_cmp( $ans2 ) );
URL:http://webwork.csis.pace.edu/webwork/cs361/ • Login: Username: practice1 to practice26 Practice1 to 4: The due date is passed. Practice 5 to 26: The due date is: 6/21/04. • Password: Choose your own password
Please, discard the error messages that may appear in the bottom of the pages! • Examples of problem sets: • Set 1 – Exercises on Recursion • Set 2 – Exercises on SML • Set 3 – Exercises on Logic Programming • Set 22 – Exercises on Number Theory • Set 44 – Exercises on Functions and Recursion
Interesting Problems: • Set 1 - Problem 1 – RecursionEval1.pg • Set 2 - Problem 2 – smltypes2.pg • Set 3 - Problem 1 – logic.pg • Set 22 - Problem 3 – decimalToRational.pg • Set 44 - Problem 4 - composition1.pg
References • http://learningcommons.evergreen.edu • http://www.cs.geneseo.edu/~baldwin/math-thinking • http://webwork.math.rochester.edu/ • http://www.acm.org/sigcse/cc2001 • A. Wildenberg and C. Scharff. Oliver: an OnLine Inference and VERification system. FIE 2002. • C. Scharff and A. Wildenberg. Teaching Discrete Structures with SML. FDPE 2002. • C. Scharff and A. Wildenberg. Supporting Discrete Structures Courses with a web-based tool. SIGCSE 2003. • C. Scharff and H. Brown. Thinking Through Computing: The Power of Learning Communities. 2004.