Upload
prosunjit-biswas
View
4.737
Download
3
Embed Size (px)
DESCRIPTION
This presentation was placed on a course project of reading course in the university of texas, san Antonio. This is a group project and the project lead was Lishu Li
Citation preview
Problem Solving in mathematics and computer science
Team members:Lishu Liu
Yun ZhangProsunjit BiswasTahmina Ahmed
Team 4Chapter 13 Reading in Mathematics
How ideas and relationships are expressed in mathematics?
Ideas and relationships are expressed through notations, symbols, numbers and formulas.Symbol: =,<,>,+,-,*,/ etc.Number: 1,2,3,0.1,1/2,logn etc.Formula: ex. y = x+2
Thought pattern in mathematics
The three patterns are: ProcessProblem solvingComparison and contrast
The kissing problem
Problem solving in mathematics- step1
Define the problemEveryone must kiss each other.We define one kiss as occurring when two people kiss each other, any number of times.
Q: How many kisses will occur if we have n people?
Problem solving in mathematics- step2
Try to solve the problem for simple cases
Problem solving in mathematics- step3
Look for a pattern or clue
n=1: 0 kiss
n=4: 3+2+1 kisses n=3: 2+1 kisses
n=2: 1 kiss
1 3
2
1
2
3
4
Problem solving in mathematics- step3 (continuing…)
n = 5, kisses = 4 + 3 + 2 + 1n = 6, kisses = 5 + 4 + 3 + 2 +1n = 7, kisses = 6 + 5 + 4 + 3 + 2 + 1
So, what can be the pattern for the kissing problem?
Problem solving in mathematics- step4
Guess and checkWhat if we have n people?
?
Problem solving in mathematics- step5
Use knowledge to solve the problem and extend the solution Kisses = (n-1) + (n-2) + … + 1
Problem solving in mathematics- step6
Try to find a better solution Kisses = (n-1) + (n-2) + … + 1
= (n + n + … + n) – (1 + 2 + … + (n-1))
= n(n-1) – n(n-1)/2 = n(n-1)/2
(n-1) factors
(n-1) factors (n-1) factors
(n-(n-1))
Summarizing steps in mathematics
Flow chart
Step 1
•Define the problem
Step 2
•Try some solution to the problem for simple cases
Step 3
•Look for a pattern or clue
Step 4
•Guess and check
Step 5
•Use knowledge to solve the problem and extend the solution
Step 6
•Try to find a better solution
Problem solving in computer science - step1
Define the problemEveryone must kiss each other.We define one kiss as occurring when two people kiss each other, any number of times.
Q: For N number of People how many kisses there will be ?
Problem solving in computer science - step2
Get sample input and output for simple casesDefine input 1, 2, 3, 4 … | | | |Define output 0, 1, 3, 6 …
Problem solving in computer science - step3
Construct logic with the patternFor first two input
So, We can assume that for n people n -1 kisses.
n=1: 0 kiss n=2 : 1 kiss
Problem solving in computer science - step3
We consider more input & output to justify our guess(kiss=n-1).
n=1: 0 kiss n=2: 1 kiss
n=3: 2 kisses n=4: 3 kisses
But this time we are indeed wrong. So, need to improve our guess.
Problem solving in computer science - step4
We will improve our solution through trial & error.
what will happen if we cannot reach the exact solution ?
Problem solving in computer science – step4
So, we will construct & justify our logic using mathematical formula.
Kisses = n (n-1) / 2
Problem solving in computer science - step5
Now we have the solutionNow its time to code !
FIND NO OF KISSES( N) KISS=N(N-1)/2RETURN KISS
Problem solving in computer science - step6
Problem solved!
Why do we really need a computer to solve the problem?
Summarizing steps in computer science
Flow chart
Step 1
•Problem Understanding
Step 2
•Get sample Input and Output
Step 3
•Construct logic with the pattern
Step 4
•Improve logic through Trial & Error
Step 5
•Finally solve the problem with mathematics
Step 6
•Fitting the mathematical solution in computer programming.
Mathematics vs. Computer Science
Mathematics Computer ScienceStep 1 Define the problem Problem understandingStep 2 Try to solve the problem for
some simple cases Get sample input and output
Step 3 Look for a pattern or clue Construct logic with the pattern
Step 4 Guess and check Improve logic through trail & error
Step 5 Use knowledge to solve the problem and extend the solution
Finally get the solution
Step 6 Try to find a better solution Problem solved
Historical relation between mathematics & computer
science
Donald Knuth (Professor of Stanford)-- Father of Analysis of Algorithm
Graduated in Mathematics (Case Institute of Tech.)PhD in Mathematics (Caltech)
Acknowledgement
Contact Person Ahmed, TahminaHandout preparation Ahmed, Tahmina & Lishu LiuProof reading Zhang, YunSlide Customization Biswas, ProsunjitContent Preparation AllSlide Preparation All
Questions?