A mother of 3 children in elementary school, Keren understands the importance of a Computer Science education from an early age. She has seen firsthand that the best way for children to retain knowledge is to have fun while learning! Keren works as Head of Creative Marketing at CodeMonkey.
Welcome to Meet the Teacher – CodeMonkey’s blog segment where teachers from all over the world share their experiences on what it’s like being an educator. Today’s post features Pam Rissmann, a STEM teacher at Dartmouth Middle School, San Jose, CA
Banana Tales Plot Twist: Let’s Code Some Math
I am a middle school STEM Teacher, and I teach computer science as well as robotics and product design. Additionally, I am our school’s Math Club coach. Last year I wanted to offer a STEM class before school, a true elective that would be open to 6th, 7th, and 8th graders. I decided to combine my love of math with my passion for coding, and offered the class, ‘Math Puzzles and Coding’.
My goal for the class is for students to think through the strategies for solving Math Olympiad type problems, which are more like puzzles than traditional classroom math problems. I also wanted to teach them Python by using CodeMonkey’s Banana Tales, and to show the students that the Python skills we learn in Banana Tales are useful for other things besides banana delivery. In fact, we could use Python to solve our math puzzles.
The general structure of the class is to begin with a few math puzzles, then students share out their methods for solving the puzzles, and then we move onto CodeMonkey’s Banana Tales challenges. Once the students learned enough basic Python syntax, around the 35th challenge, then we started coding the math.
We started by coding the math in the Banana Tales environment. We just commented out an existing challenge, and wrote our math code there instead. We coded the math, so the answer would be printed in the console. For example, this (figure 1) is how we used Python to find the perfect squares less than 100.
Figure 1. Code for printing out perfect squares less than 100
I think coding up the math puzzles helped reinforce the Python concepts like: for loops, if statements, lists, and other concepts that are closely tied to the Banana Tales “game”. It helped the students realize that these constructs are general purpose methods, and are not just to be applied to giraffes, elephants, etc. in the Banana Tales challenges.
Coding up math puzzles in Python were also a great launchpad for thinking about the math in different ways and for learning other Python commands as a part of the problem-solving process.
For example, we solved this puzzle first with pencil and paper:
How many integers between 100 and 1000 contain only the digits: 3, 4, or 5?
On paper, we know the numbers must be between 300 and 599. We also know that it is best if we organize our thinking, because often a pattern arises when we do that. Listing out the numbers in the 300s, we get: 333, 334, 335, 343, 344, 345, 353, 354, 355. Now that same number of solutions must exist in the 400s and 500s. So 9 x 3 = 27 integers.
Coding this problem is actually very different from solving it with pencil and paper, since we want the computer to analyze each digit of the number, which isn’t what it is used to doing. We have to figure out how to decompose a 3-digit number into its individual digits. In other words, how do we get the computer to just look at the hundreds value or tens value or the ones (unit) value? We found two ways of doing it, but there’s probably even more ways.
First (Fig.2) method was to use division(/) and modulo/remainder (%) to get at the different digits. The second way (Fig 3) was to convert the integer into a string, and then to look at each character (digit) of the string.
Figure 2 – Used division and modulo operators to extract the individual digits from the integer, i. Figure 3: Converted the integer, i, to a string, and then analyzed each digit
I think what I like most about coding math problems is that it helps the students understand the math problems more because they have to “teach” the computer to solve them. Some of my students really took off with this, and started asking me for more math problems to code at home. I eventually discovered https://projecteuler.net/, a website dedicated to coding math problems! Once registered with the site, you are given math problems to code and solve, and there is a community who you can share your insights with as well as your questions.
ABOUT THE AUTHOR
Pam Rissmann is a middle school STEM teacher who teaches computer science, robotics, and product design. She has been teaching for 15 years, and in addition to teaching, she coaches her school’s competitive math club and STEM Girls club. Pam is a recipient of the Santa Clara County/Texas Instruments STEM teacher award and California League of Middle School Teacher of the Year for her school. Pam was awarded by Project Lead the Way the Outstanding Gateway Teacher award in 2019. Follow Pam on Twitter: @pperfectsquares
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies. However you may visit Cookie Settings to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Cookie
Type
Duration
Description
_codemonkey_session_rails_4
1
1 year
_ga
persistent
2 years
This cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, campaign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assign a randomly generated number to identify unique visitors.
cookielawinfo-checkbox-advertisement
persistent
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Advertisement".
cookielawinfo-checkbox-analytics
persistent
11 months
This cookies is set by GDPR Cookie Consent WordPress Plugin. The cookie is used to remember the user consent for the cookies under the category "Analytics".
cookielawinfo-checkbox-functional
persistent
11 months
cookielawinfo-checkbox-necessary
persistent
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-non-necessary
0
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Non Necessary".
cookielawinfo-checkbox-other
persistent
11 months
cookielawinfo-checkbox-performance
persistent
11 months
This cookie is used to keep track of which cookies the user have approved for this site.
JSESSIONID
1
1 year
Used by sites written in JSP. General purpose platform session cookies that are used to maintain users' state across page requests.
viewed_cookie_policy
persistent
1 hour
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
XSRF-TOKEN
persistent
1 year
The cookie is set by Wix website building platform on Wix website. The cookie is used for security purposes.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Cookie
Type
Duration
Description
rlas3
persistent
11 months
The cookie is set by rlcdn.com. The cookie is used to serve relevant ads to the visitor as well as limit the time the visitor sees an and also measure the effectiveness of the campaign.
UserMatchHistory
persistent
1 month
Linkedin - Used to track visitors on multiple websites, in order to present relevant advertisement based on the visitor's preferences.
This cookie is set by Google Analytics and is used to distinguish users and sessions. The cookie is created when the JavaScript library executes and there are no existing __utma cookies. The cookie is updated every time data is sent to Google Analytics.
__utmb
persistent
30 minutes
The cookie is set by Google Analytics. The cookie is used to determine new sessions/visits. The cookie is created when the JavaScript library executes and there are no existing __utma cookies. The cookie is updated every time data is sent to Google Analytics.
__utmc
persistent
1 year
The cookie is set by Google Analytics and is deleted when the user closes the browser. The cookie is not used by ga.js. The cookie is used to enable interoperability with urchin.js which is an older version of Google analytics and used in conjunction with the __utmb cookie to determine new sessions/visits.
__utmt
persistent
10 minutes
The cookie is set by Google Analytics and is used to throttle request rate.
__utmz
persistent
6 months
This cookie is set by Google analytics and is used to store the traffic source or campaign through which the visitor reached your site.
_gat
persistent
1 minute
This cookies is installed by Google Universal Analytics to throttle the request rate to limit the colllection of data on high traffic sites.
YSC
1
1 year
This cookies is set by Youtube and is used to track the views of embedded videos.
This cookie is used by Google Analytics to understand user interaction with the website.
_gid
persistent
1 day
This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the wbsite is doing. The data collected including the number visitors, the source where they have come from, and the pages viisted in an anonymous form.
GPS
persistent
30 minutes
This cookie is set by Youtube and registers a unique ID for tracking users based on their geographical location
MR
persistent
5 months
This cookie is used to measure the use of the website for analytics purposes.
MUIDB
1
1 year
This cookie is used by MicroSoft and collects data about users of visits on multiple website. This data is used to analyze the efficiency of advertisements on websites.
This cookie is set by Facebook to deliver advertisement when they are on Facebook or a digital platform powered by Facebook advertising after visiting this website.
bscookie
1
2 years
This cookie is a browser ID cookie set by Linked share Buttons and ad tags.
fr
1
3 months
The cookie is set by Facebook to show relevant advertisments to the users and measure and improve the advertisements. The cookie also tracks the behavior of the user across the web on sites that have Facebook pixel or Facebook social plugin.
IDE
1
2 years
Used by Google DoubleClick and stores information about how the user uses the website and any other advertisement before visiting the website. This is used to present users with ads that are relevant to them according to the user profile.
MUID
persistent
1 year
Used by Microsoft as a unique identifier. The cookie is set by embedded Microsoft scripts. The purpose of this cookie is to synchronize the ID across many different Microsoft domains to enable user tracking.
pxrc
persistent
2 months
The purpose of the cookie is to identify a visitor to serve relevant advertisement.
rlas3
persistent
11 months
The cookie is set by rlcdn.com. The cookie is used to serve relevant ads to the visitor as well as limit the time the visitor sees an and also measure the effectiveness of the campaign.
skimCSP
persistent
11 months
This cookie is set by SkimResources. The cookie is used to record data on the visitor to optimize the relevance of the advretisements served to the users.
TapAd_DID
persistent
2 months
The cookie is set by tapad.com. The purpose of the cookie is to track users across devices to enable targeted advertising
TapAd_TS
persistent
2 months
The cookie is set by Tapad.com. The purpose of the cookie is to track users across devices to enable targeted advertising.
TDCPM
persistent
1 year
The cookie is set by CloudFare service to store a unique ID to identify a returning users device which then is used for targeted advertising.
TDID
persistent
1 year
The cookie is set by CloudFare service to store a unique ID to identify a returning users device which then is used for targeted advertising.
test_cookie
persistent
15 minutes
This cookie is set by doubleclick.net. The purpose of the cookie is to determine if the users' browser supports cookies.
VISITOR_INFO1_LIVE
1
5 months
This cookie is set by Youtube. Used to track the information of the embedded YouTube videos on a website.