Dream to Learn is shutting down...

We are very sorry to say that Dream to Learn will be shutting down as of December 28th, 2019. If you have content that you wish to keep, you should make a copy of it before that date.


0COMMENTS0RECOMMENDS

Brute Force Math - with Python!

02
POSTED IN: Getting Kids Excited about STEM, Computer Science and Electrical Engineering

Teaching kids about "brute force' methods to solve problems or gain access

 

Math Problem

  • 10 digit number 3,872,649,A0B

  • is divisible by 36

  •  The letters A and B each represent single digit EVEN numbers  (0,2,4,6,8)

  •  GOAL: Find sum of A and B

# L&J - this is a sample program of how to leverage computing power
# to "brute force" a problem.  In this case - we are going to use a
# Loop to try EVERY possible combination answer to your question
# while at time inelegant - it can be effective for solving problems
# black hat hackers also use this to try to crack passwords

Code:

https://github.com/rustyoldrake/Catchers_Mitt/blob/master/brute_force_math.py

 

 

 

https://github.com/rustyoldrake/Catchers_Mitt/blob/master/brute_force_math.py

 

PS - the answer is SIX

 

Interested in more content by this author?

About the Author

Ryan Anderson

Ryan Anderson

Hi! I like to play with data, analytics and hack around with robots and gadgets in my garage. Lately I've been learning about machine learning.

About this blog

Created: March 16, 2017

English

Up Next