Doing Math with Python: Use Programming to Explore Algebra, by Amit Saha

By Amit Saha

Doing Math with Python exhibits you ways to take advantage of Python to delve into excessive school—level math subject matters like records, geometry, chance, and calculus. You'll begin with basic initiatives, like a factoring software and a quadratic-equation solver, after which create extra complicated tasks as soon as you've gotten the grasp of things.

Along the way in which, you'll become aware of new how you can discover math and achieve priceless programming abilities that you'll use all through your examine of math and desktop technological know-how. find out how to:

Describe your facts with records, and visualize it with line graphs, bar charts, and scatter plots
discover set conception and chance with courses for coin flips, dicing, and different video games of chance
remedy algebra difficulties utilizing Python's symbolic math functions
Draw geometric shapes and discover fractals just like the Barnsley fern, the Sierpinski triangle, and the Mandelbrot set
Write courses to discover derivatives and combine functions

Creative coding demanding situations and utilized examples assist you see how one can placed your new math and coding talents into perform. You'll write an inequality solver, plot gravity's impression on how some distance a bullet will trip, shuffle a deck of playing cards, estimate the realm of a circle through throwing 100,000 "darts" at a board, discover the connection among the Fibonacci series and the golden ratio, and more.

Whether you're drawn to math yet haven't begun to dip into programming or you're a instructor seeking to carry programming into the study room, you'll locate that Python makes programming effortless and functional. allow Python deal with the grunt paintings when you specialise in the mathematics.

Show description

Read Online or Download Doing Math with Python: Use Programming to Explore Algebra, Statistics, Calculus, and More! PDF

Similar python books

Pro Django

Django is the prime Python net program improvement framework. the right way to leverage the Django internet framework to its complete power during this complicated educational and reference. counseled by way of Django, seasoned Django kind of alternatives up the place The Definitive consultant to Django left off and examines in better element the weird and intricate difficulties that Python net program builders can face and the way to resolve them.

Python and HDF5

Gain hands-on event with HDF5 for storing medical information in Python. This useful advisor speedy will get you on top of things at the information, top practices, and pitfalls of utilizing HDF5 to archive and percentage numerical datasets ranging in dimension from gigabytes to terabytes.

via real-world examples and functional workouts, you’ll discover issues comparable to clinical datasets, hierarchically equipped teams, user-defined metadata, and interoperable records. Examples are appropriate for clients of either Python 2 and Python three. If you’re accustomed to the fundamentals of Python information research, this is often an awesome advent to HDF5.
• Get organize with HDF5 instruments and create your first HDF5 dossier
• paintings with datasets through studying the HDF5 Dataset item
• comprehend complex positive aspects like dataset chunking and compression
• how one can paintings with HDF5’s hierarchical constitution, utilizing teams
• Create self-describing records via including metadata with HDF5 attributes
• benefit from HDF5’s variety method to create interoperable documents
• exhibit relationships between facts with references, named kinds, and measurement scales
• realize how Python mechanisms for writing parallel code have interaction with HDF5

The Definitive Guide to Jython: Python for the Java Platform

Jython is an open resource implementation of the high-level, dynamic, object-oriented scripting language Python seamlessly built-in with the Java platform. The predecessor to Jython, JPython, is qualified as a hundred% natural Java. Jython is freely to be had for either advertisement and noncommercial use and is sent with resource code.

A functional start to computing with Python

A useful begin to Computing with Python allows scholars to quick study computing with no need to take advantage of loops, variables, and item abstractions initially. Requiring no previous programming adventure, the e-book attracts on Python’s versatile facts varieties and operations in addition to its ability for outlining new features.

Additional info for Doing Math with Python: Use Programming to Explore Algebra, Statistics, Calculus, and More!

Example text

For example, in the first chapter we imported the Fraction class as from fractions import Fraction. Importing an entire module is useful when you’re going to use a number of functions from that module. Instead of importing them individually, you can just import the whole module at once and refer to different functions when you need them. In the create_graph() function at v, we create the two lists of numbers that we want to plot on the graph and then pass the two lists to the plot() function, the same way we did before with pylab.

Format(item1, item2, item3)) At the grocery store, I bought some apples and bananas and grapes First, we created three labels (item1, item2, and item3), each referring to a different string (apples, bananas, and grapes). Then, in the print() function, we typed a string with three placeholders in curly brackets: {0}, {1}, and {2}. format(), which holds the three labels we created. This tells Python to fill those three placeholders with the values stored in those labels in the order listed, so Python prints the text with {0} replaced by the first label, {1} replaced by the second label, and so on.

On the other hand, for equations such as x 2 + 2x + 1 = 0, finding the roots of x usually involves evaluating a complex expression known as the quadratic formula. Such equations are known as quadratic equations, generally expressed as ax 2 + bx + c = 0, where a, b, and c are constants. The quadratic formula for calculating the roots is given as follows: and . A quadratic equation has two roots—two values of x for which the two sides of the quadratic equation are equal (although sometimes these two values may turn out to be the same).

Download PDF sample

Rated 4.06 of 5 – based on 30 votes
Posted In CategoriesPython