1 / 44

OCTM 2011

Using Computer Programming to Teach Mathematics Norm Krumpe Miami University norm.krumpe@muohio.edu http://mathandcomputing.com/ octm. OCTM 2011. Problem:. I have two prime numbers. Their product is 91. What are the numbers? I have two prime numbers. Their product is 1829.

bessie
Download Presentation

OCTM 2011

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using Computer Programming to Teach MathematicsNorm KrumpeMiami Universitynorm.krumpe@muohio.eduhttp://mathandcomputing.com/octm OCTM 2011

  2. Problem: • I have two prime numbers. Their product is 91. • What are the numbers? • I have two prime numbers. Their product is 1829. • What are the numbers? • How long would it take you to figure this out? • I have two prime numbers. Their product is 4309597. • What are the numbers? • How long would it take you to figure it out? • How long would it take a computer to figure it out?

  3. One more...factor this: • 245246644900278211976517663573088018467026787678332759743414451715061600830038587216952208399332071549103626827191679864079776723243005600592035631246561218465817904100131859299619933817012149335034875870551067 • Question: How long would it take a computer to factor this? • Answer: It has never been accomplished. • See the wikipedia article "RSA Numbers"

  4. why does it matter? • It is very easy to generate numbers like these. • It is very very difficult to factor numbers like these. • This mathematics is the basis for encryption and decryption: • Encrypt by multiplying big prime numbers together. • Decryption is difficult because it requires being able to factor those big prime numbers. (It's only easy for the person who already knows the prime numbers that were used.)

  5. computer science:Did you know… • That 0, 150, 0 means "dark blue"? • That 209.85.225.104 is Google? • That "random" numbers on your calculator are not random at all? They are generated from mathematical formulas. • Many programming languages will give the incorrect result for 0.1 + 0.1 + 0.1?

  6. math and computing • Computer science and computer programming are deeply connected. • Computer science can help us solve problems in mathematics. • Mathematics can help us solve problems in computing.

  7. computer science vs.computer programming • Computer science is a broad subject including: • Computer programming • Architecture • Networks and communication • Algorithms • Artificial Intelligence • Operating systems • Databases • Graphics • Computer programming is a tool that is used to solve problems in these areas. • Computer programming is a tool that is used to solve problems in other areas as well.

  8. computer science unplugged • http://csunplugged.org

  9. our focus: computer programming • In 50 minutes, I want to convince you that: • Programming belongs in mathematics classrooms • It is easy to get set up • It is easy to write your first program • Programming is fun

  10. my focus will be on computers: • But…TI graphing calculators offer a rich environment as well.

  11. why programmingis worthwhile: • "Computer Software Engineer" is near the top of nearly every list of "promising careers" • The recently introduced "Computer Science Education Act" seeks to " Ensure computer science offerings are an integral part of the [K-12] curriculum"

  12. but why in a math class? • Computer programming is the right tool to solve problems in the mathematics you already teach. • Computer programming lets you get at other mathematics that maybe you should teach.

  13. Mathematics you already teach: • Precalculus • trigonometric functions • exponential functions • logarithmic functions • functions in general • Calculus • differentiation • integration • sequences and series • Other topics • logic • mathematical induction • matrices • complex numbers • prime numbers • Algebra • variables • functions • recursion • iteration • Geometry • 2-D and 3-D shapes and properties • analytic geometry • Probability and statistics • Analyzing data • Random numbers • Simulation

  14. computer concepts related to math you might one day teach: • Data abstraction and data structures • trees • graphs • algorithm efficiency • Graphics • raster graphics • vector graphics • 2-D and 3-D coordinate systems • color • animation • Programming • logic • loops • limitations • Computer fundamentals • binary numbers • bits and bytes • data storage • data representation • central processing unit (CPU) • Moore's law • Networks • privacy and security • data compression • encryption/decryption • IP addresses • topology

  15. background • As early as 1967, people were asking the question, How can kids learn to program? • Logo was invented by Seymour Papert and others at MIT.

  16. Logo:

  17. my own math teaching experiences with programming: • Logo in algebra, precalculus • "Write a program which will take any two side lengths and included angle and draw the corresponding triangle." • POV-Ray (3D graphics) in precalculus, calculus • "Write a program that computes the 3-D coordinates of a tetrahedron with sides of length 10, and draws it." • TI Graphing Calculator Programming in algebra, precalculus, calculus, discrete mathematics • "Write a program that asks the user to enter the current time in hours and minutes, and draw the corresponding clock, with hour hand and minute hand." • Processing for inservice secondary mathematics teachers

  18. programming is not just for hobbyists: • Programming is a powerful tool for solving problems.

  19. A problem from your math class: • How many boxes of cereal to you need to buy in order to collect all six randomly distributed playing cards? This short program performs the experiment 500 times and stores the data in a list.

  20. Programming resources: • Processing • http://processing.org • Logo • http://fmslogo.org • http://www.alancsmith.co.uk/logo/ • POV-Ray • http://povray.org • Graphing calculators • TI-82/83/84/85/86/89/92 and on and on

  21. processing: • My new go-to language for teaching beginning programming • Super easy to get started with graphics • Super powerful for data visualization • Excellent way to be artistic and mathematical, all at once • Miami uses it for their "Aesthetics and Computation" course

  22. my favorite aspect of processing: • Students start a lot of sentences with the phrase: • "I wonder how you would…" • And that never happened in my calculus class

  23. how to get started in processing: • Download Processing (free) from http://processing.org • Get inspired using the many built-in examples • Do some tutorials at http://processing.org • Find a good book on Processing. I recommend "Learning Processing". • Let your students get started and some will run with it!

  24. challenge#1: • Write a program that draws a yellow circle of radius 25 at the center of the left edge of the screen. • How does the coordinate system work? • How does the color system work?

  25. Coordinate system:

  26. color system: RGB • Color can be expressed as a combination of red, green, and blue light: • Red light can range from integers 0 through 255 • Green light can range from integers 0 through 255 • Blue light can range from integers 0 through 255 • So, what are each of these colors? • 255, 0, 0 • 120, 0, 0 • 0, 0, 200 • 255, 255, 255 • 0, 0, 0 • 130, 130, 130 • 255, 255, 0 • Answers: red, darker red, blue, white, black, grey, yellow

  27. color system: RGB • How many colors are possible using this system? • 256^3 • Is it possible to show all of these colors at once on the screen? • This computer screen has a resolution of 1280 x 800 pixels = roughly 1 million pixels = 1 megapixel • But 256^3 is 16,777,216

  28. challenge #2: • Make an infinite number of random circles on the screen. • How do random numbers work? • How do you make an infinite number of circles?

  29. challenge #3: • Make the original yellow circle animate from left to right. • How do the numbers in the ellipse() function need to change?

  30. challenge #4: • Make the circle reappear on the left side once it leaves the right side.

  31. challenge #5: • Put a mouth on this Pac-Man • Make it open and close

  32. Other challenges(and their solutions)

  33. fill the screen with rows and columns of circles

  34. Color enhanced:

  35. The Circle game • Inscribe a circle in the screen • Randomly mark points on the screen • Count how many of those points are inside the circle • Use that count to estimate Pi.

  36. the main logic:

  37. the result: 3.1648

  38. new problem:the midpoint game • Begin with: • 3 triangle vertices, numbered 1 to 3 • 1 random point • Pick a random number from 1 to 3 • Move halfway to that vertex • Repeat

  39. midpoint problem: • Main part of the solution, and the final result:

  40. Color-enhanced by one of my students:

  41. this pattern exists elsewhere:

  42. this pattern exists elsewhere:

  43. easy to program on a calculator: • This was made on a calculator in roughly 5 minutes of programming:

  44. find all of today's presentation at: • http://mathandcomputing.com/octm

More Related