addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonJoin Group on CardStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Re: [pyatl] Discrete Math and Python

From: Sean
Sent on: Saturday, September 12, 2009 3:49 AM
For really basic stuff, sage is overkill. But since it's really just
Python with a ton of math libraries and such, you can do the simple
stuff and more advanced stuff as you need it. For instance, if you
wanted to cover graph theory at some point, you wouldn't have to tell
your students to go and install NetworkX. It's already there. I don't
know if you've used NetworkX before, but it's pretty awesome. Here's a
simple example to display a petersen graph, find the graph's chromatic
number and check if it's connected:

from sage.graphs import graph_generators
g = graphs.PetersenGraph­()
print g.is_connected()
print g.chromatic_number()­

and it'll print out its chromatic number (3) and checks if it is
connected (it is) and displays the graph:­

Making your own graphs is really easy as well. I won't go into that
though. I feel like I've said enough :-)

On Sat, Sep 12, 2009 at 2:14 AM, Skylar Saveland
<[address removed]> wrote:
> I'm creating a course in discrete math and python and would be glad to have
> input and code reviews.
> Some of my first programs would be like:
> ? 1) Given an iterable and a positive integer, return the unique
> permutations (unique lists) and unique combinations (sets).
> ? 2) Given a string, return the set of all unique permutations (as strings)
> Maybe even showing a few ways to do it in Python and why one way is more
> efficient and/or pythonic.
> I'm looking at these as outlines:
> http://www.math.j...­
> A great project is http://www.sagema...­.
> I might get back into that code (they have a ton of great math built on
> python) but I kind of want to naively think things through from a basic
> level so it will make a good course.
> Cheers,
> Skylar Saveland
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on
> this mailing list ([address removed])
> This message was sent by Skylar Saveland ([address removed]) from
> PyAtl: Atlanta Python Programmers.
> To learn more about Skylar Saveland, visit his/her member profile
> To unsubscribe or to update your mailing list settings, click here
> Meetup Support: [address removed]
> 632 Broadway, New York, NY 10012 USA

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy