Computer Programming is not a Math Credit
About Me Cam Joyce Johnston Heights joyce_c@surreyschools.ca Teach Math and CS Department head 3 blocks ICTP/APCS ADST/Math Curriculum writer Computing Science Computer Programming
Friction Mathematicians are required to take a computer programming course in the faculty of computing science This is where I switched majors… Associate computer science to be computer programming Computer Programming is to Computing Science as a Calculator is to a Mathematician Computer Programming is a tool Computing Science is a discipline I’m not suggesting you teach CS without CP… A computer lab should be required for this course
I’m still learning I’m not perfect I’m sharing what I’m working on Many of these activities alone would take the full workshop
Low Hanging Fruit CS post secondary stakeholders will still require PC12 for entrance CS students in high school will likely be taking more than one math class Content ways to model mathematical problems mathematical problems: — estimate theoretical probability through simulation, sequences, and series; solve a system of linear equations, exponential growth/decay; solve a polynomial equation; calculate statistical values such as frequency, central tendencies, standard deviation of large data set, or greatest common factor/least common multiples These are the class of problems where you could use CS to reinforce their understanding of the mathematics Tell Me and I’ll forget, Show me and I may remember, Involve me and I’ll understand Tedious tasks fit well here: Numerical methods for Calculus students Factor/Rational Roots Theorem for PC12
The Missile Problem When are we ever going to use this stuff? API default is center addObject(new Missile(), getX(), getY()); What I’d Like, looks like this: How do I do it given only the rotation of the ship, center x and y of ship and width/height of ship/missile?
The Missile Problem (??, ??) mw sw (sx,sy)
Extension – Real Vs Integer
Precision Pixels are integers but movement into locations is with decimal numbers With a speed of 1, that means the movement of an Actor is limited to the adjacent cells: That means no matter what the angle, only 8 moves are possible If speed = 2 there would be 16 locations to choose sw/2 + mw/2 vs. (sw + mw)/2 A
Curriculum Big Idea Content Competencies Decomposition allows us to reduce complexity and solve problems. Content ways to represent basic data types ways to model mathematical problems basic programming concepts problem decomposition through modularity Competencies Use tools or technology to analyze relationships and test conjectures Model mathematics in contextualized experiences Connect mathematical and computer science concepts to each other and to other areas and personal interests
We can Do Better Writing code to perform calculations is not developing the “habits of mind” of a computer scientist What are the habits of mind we are trying to develop?
Computational Thinking (CSTA) Computational thinking (CT) is a problem-solving process that includes (but is not limited to) the following characteristics: Formulating problems in a way that enables us to use a computer and other tools to help solve them. Logically organizing and analyzing data Representing data through abstractions such as models and simulations Automating solutions through algorithmic thinking (a series of ordered steps) Identifying, analyzing, and implementing possible solutions with the goal of achieving the most efficient and effective combination of steps and resources Generalizing and transferring this problem solving process to a wide variety of problems These skills are supported and enhanced by a number of dispositions or attitudes that are essential dimensions of CT. These dispositions or attitudes include: Confidence in dealing with complexity Persistence in working with difficult problems Tolerance for ambiguity The ability to deal with open ended problems The ability to communicate and work with others to achieve a common goal or solution
Battleship 1 Organise yourselves into pairs. One of you has sheet 1A, the other sheet 1B. Don’t show your sheet to your partner! Both of you circle one battleship and tell your partner its number. Now take turns to guess where your partner’s ship is. You say the letter name of a ship and your partner tells you the number of the ship at that letter. How many shots does it take to locate your partner’s ship? This is your score for the game.
Questions What are the minimum and maximum scores possible? What do you think would be a “reasonable” score? What if we changed the number of ships to 100 What would be the minimum and maximum scores possible? What if we changed the number of ships to 1000
Battleship 2 Organise yourselves into pairs. One of you has sheet 2A, the other sheet 2B. Don’t show your sheet to your partner! Both of you circle one battleship and tell your partner its number. Now take turns to guess where your partner’s ship is. (You say the letter name of a ship and your partner tells you the number of the ship at that letter.) How many shots does it take to locate your partner’s ship? This is your score for the game.
Questions What strategy did the low scorers use? Which ship should you choose first? Which location would you choose next? If someone was very strategic… What are the minimum and maximum scores possible? If there were 52 ships and someone was very strategic… If there were 104 ships and someone was very strategic… If there were 1000 ships and someone was very strategic…
Student Work
Student Work
Curriculum Big Idea Curricular Content Curricular Competencies Algorithms are essential in solving problems computationally. Curricular Content development of algorithms to solve problems in multiple ways techniques for operations on and searching of arrays and lists uses of computing for financial analysis ways to model mathematical problems Curricular Competencies Apply flexible strategies to solve problems in both abstract and contextualized situations Visualize to explore and illustrate mathematical concepts and relationships Explain and justify mathematical and computational ideas Use tools or technology to analyze relationships and test conjectures Use mathematics and computer science to support personal choices Connect mathematical and computer science concepts to each other and to other areas and personal interests
Warmup In front of you are film containers They each contain a different number of ball bearings Can you find the lightest container using the scale?
Algorithms Write an algorithm to describe how your group was able to find the lightest canister Exchange your algorithm with another group and see if you can follow their instructions You should not do any more or less than is stated If their algorithm fails, give it back and ask them to make some changes How many times do you need to use the scale to complete this task?
Sorting
Sorting Can you sort the film canisters from lowest to highest using only the balance scale to inform your decisions? Write an algorithm to describe how to sort the canisters and exchange it with another group. You should not do any more or less than is stated If their algorithm fails, give it back and ask them to make some changes How many times do you need to use the scale to complete this task?
Selection Sort Find the smallest value in the data Put it in the next position of the sorted list
Selection Sort Analysis How good do you think your strategy is? If there were 5 items, what’s the most number of weighings you’d need to do? If there were 10 items, what’s the most number of weighings you’d need to do? If there were 100 items, what’s the most number of weighings you’d need to do? If there were n items, what’s the most number of weighings you’d need to do? Does the initial configuration of the data influence the speed of selection sort? Can you improve your strategy? What will Selection Sort do with already sorted data? Is there a better algorithm?
Mergesort Split your list in half until you reach sorted sub-lists (singletons) Merge the sorted lists together This process is quicker than it looks because you need only compare the first element in both lists to decide which to use
Mergesort Analysis How good do you think your strategy is? If there were 8 items, what’s the most number of weighings you’d need to do? If there were 16 items, what’s the most number of weighings you’d need to do? If there were 256 items, what’s the most number of weighings you’d need to do? If there were n items, what’s the most number of weighings you’d need to do? Can you improve your strategy? Is there a better algorithm?
Student Work
Curriculum Big Idea Curricular Content Curricular Competencies Solving problems is a creative process. Curricular Content algorithms, including sorting and searching performance analysis by Big-O notation recursive problem solving Curricular Competencies Model mathematics in contextualized experiences Represent mathematical ideas in a variety of ways Explain and justify mathematical and computational ideas Reflect on mathematical and computational thinking
Can you find the equation?
Resources CS Unplugged Project Euler CSTA Bootstrap CodingBat Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems. CSTA Computing Science Teacher’s Association Bootstrap A full, in-school curriculum and software package that teaches children to program their own videogames using purely algebraic concepts. CodingBat Pythontutor.com (also Java) Greenfoot
Thanks! Cam Joyce Johnston Heights Secondary joyce_c@surreyschools.ca