Skip to content

Instantly share code, notes, and snippets.

Robert Talbert RobertTalbert

Block or report user

Report or block RobertTalbert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
RobertTalbert /
Created Feb 2, 2017
Solution to MTH 325 Guided Practice 7 review question 2.
import networkx as nx
import matplotlib.pyplot as plt
g = nx.Graph( [(0, 3), (1, 2), (1, 4), (2, 3), (3, 4)])
nx.draw(g, with_labels=True, node_color="orange")

Since taking over the facilitation of the Pew FTLC Grants Program in May 2013, I have made two significant enhancements to the Faculty Conference Travel Grant in consultation with the Pew FTLC faculty/staff, the Pew FTLC Advisory Committee, the Pew FTLC Grants Sub-Committee , and in response to questions/concerns raised by faculty from across the university. Each quarter, the window of time between when the grant system opened and the funding was depleted grew shorter until it became an online race to see which faculty could get into the system first and have access to funds. It was clear that the demand for grant funds was far surpassing the supply and that many of the same faculty were receiving funding year after year. Our first revision to the grant was to implement an every-other-year eligibility so that we could distribute the funds more widely among the faculty. While this temporarily took some pressure off of the online system, our applicant pool continued to grow to the extent that funds were

View MTH 325 W17 syllabus

MTH 325 course banner

About this course and the syllabus

Welcome to MTH 325, Discrete Structures for Computer Science 2. This document contains all the information you need to know about the course. Your job is to read this document carefully in the first week of class and familiarize yourself with how the course works and maintain that familiarity throughout the semester. Almost all questions about the course that you might ask can be answered by referencing the syllabus.

Course catalog description: Properties of relations, equivalence relations, partial orderings, fundamental concepts of graphs, trees, digraphs, networks, and associated algorithms; computer science applications. Offered fall and winter semesters. Prerequisite: MTH 225.

Course information

Generates a random weighted graph.
n = Number of nodes.
p = Probability of two nodes being connected. Must be between 0 and 1.
Weights on the edges are randomly generated integers situated between lower_weight and upper_weight.
Example: random_weighted_graph(6, 0.25, 10, 20) creates a weighted graph with 6 nodes, a 1/4 probability
of two nodes being connected, and weights on the edges randomly selected between 10 and 20.
def gnp_random_weighted_graph(n,p,wlow,whigh):

MTH 325: Discrete Structures for Computer Science 2

Guided Practice 13: Hamilton Paths


In the last lesson, we learned about Euler paths, which are paths in a graph that traverse all the edges of a graph exactly once. We can ask a similar question about whether there is a path in a graph that visits each vertex exactly once. That kind of path is called a Hamilton path. This lesson focuses on developing some rules for knowing whether Hamilton paths exist in a graph. This turns out to be a much harder problem than finding Euler paths! So we will be working toward 2-3 theoretical results that give some conditions under which Hamilton paths exist.


Guided Practice for 1.6: The second derivative


In this section we study the second derivative of a function, which is just the derivative of the first derivative. That is -- "taking a derivative" is something we do to a function, and since the derivative f' is a function, we can take its derivative too. The second derivative is an important ingredient for understanding the subtle behaviors of a function, and in particular the concept of concavity will distinguish between a function that is increasing at an increasing pace and a function that is increasing at a decreasing pace. Our main highlight for this section is to have a clear understanding of the relationships between the sign of f', the sign of f'' (the second derivative), the increasing/decreasing behavior of f, and the concavity of f.

Learning objectives

BASIC learning objectives

Each student will be responsible for learning and demonstrating proficiency in the following objectives PRIOR to the class meeting. **The e

RobertTalbert /
Created Sep 23, 2016
Recursive function for the binomial coefficient
def rec_binom(n,k):
if (k == 0) or (n == k): return 1
return binom(n-1, k) + binom(n-1, k-1)

Testing git

$$\int \frac{1}{1+x^2} , dx = \arctan(x) + C$$

Written with StackEdit.

View Marking Eulerian and Hamiltonian circuits on a graph
# Eulerian circuits
EC = g.eulerian_circuit()
# Hamiltonian circuits
hc = g.hamiltonian_cycle().edges(labels=False){'red':hc})
RobertTalbert /
Created Feb 19, 2016
SageMath implementation of Warshall's algorithm
def warshall(M):
n = M.nrows()
W = M
for k in range(n):
for i in range(n):
for j in range(n):
W[i,j] = W[i,j] or (W[i,k] and W[k,j])
return W
You can’t perform that action at this time.