Skip to content

Instantly share code, notes, and snippets.


Robert Talbert RobertTalbert

View GitHub Profile

If you have difficulty affording groceries or accessing sufficient food to eat every day, or if you lack a safe and stable place to live, I encourage you to visit Replenish, a food resource for GVSU students. If you are comfortable doing so, please speak with me about your circumstances so that I can advocate for you and to connect you with other campus resources.

View Stars and
# To find the natural number solutions to x + y + z = 8
[(x,y,z) for x in range(9) for y in range(9) for z in range(9) if x+y+z == 8]
# To generate the ways to pick 6 donuts from an unlimited supply of glazed, chocolate, and jelly-filled
[(g,c,j) for g in range(7) for c in range(7) for j in range(7) if g+c+j == 6]
# Put `len( )` around these lists to find the number of items in the list.
View Recursive
# The first recursive function we saw.
# Turns out it has the closed formula f(n) = n(n+2) although we didn't prove it.
def f(n):
if n == 0: return 0
else: return f(n-1) + 2*n + 1
# AKA the factorial function:
def g(n):
View MTH 225 module level objectives.tex
\section{Appendix B: MTH 225 Learning Targets}
\begin{subsubsection}{Module 1: Computer Arithmetic}
\item[CA.1] \textbf{(CORE)} \ I can represent an integer in base 2, 8, 10, and 16 and represent a negative integer in base 2 using two's complement notation.
\item[CA.2] I can perform addition, subtraction, multiplication, and division in binary.
View MTH 225

Course module structure: The course content is split up into five modules:

  • Module 1: Computer arithmetic. Representing integers in binary, octal, and hexadecimal; binary arithmetic; the Division Algorithm and modular arithmetic.

  • Module 2: Logic. Logical propositions, conditional statements, truth tables, predicates, and quantification.

View MTH 225 course level

Course-level learning objectives: Upon completion of MTH 225, you will be able to:

  • Represent integers using different number bases, and perform integer arithmetic using different bases and modular arithmetic.

  • Formulate, manipulate, and determine the truth of logical expressions using symbolic logic.

  • Formulate and solve computational problems using sets and functions.


MTH 225 Learning Objectives

By module

  • Module 1: Arithmetic
    • Given an integer in base 2, 8, 10, or 16, represent it using another base.
    • Add, subtract, multiply, and divide integers in base 2, 8, and 16.
    • Use two's complement to represent a negative integer in binary.
  • State the Division Algorithm and use it to find the quotient and remainder when dividing one positive integer by another.

Semper Libero condimentum praesent consectetuer eget ornare aliquam sagittis ligula nonummy. Placerat libero laoreet sed orci vitae id sit vestibulum sit mi mattis. Eleifend sollicitudin phasellus litora sem sociis vel ac dignissim auctor venenatis hendrerit ornare dolor inceptos ante class. Praesent lectus conubia bibendum class iaculis odio potenti fermentum amet fusce vulputate ultricies cum phasellus sed volutpat ligula. Eros. Dictum sociis ultricies accumsan mus. Congue est convallis elit velit facilisis a commodo convallis torquent feugiat.

Parturient, pharetra mattis felis nam magnis. Dolor tristique. Eu Sagittis quis hendrerit tempus scelerisque mus aliquam ipsum, commodo senectus mattis adipiscing inceptos. Proin molestie ad aliquam curae; ligula habitasse curae; sem gravida magna scelerisque tortor nisl eleifend sapien aptent cum accumsan sociis porttitor mi. Primis. Netus sagittis et, aliquam erat sit posuere nonummy tellus euismod donec vivamus. Ad sollicitudin Quis platea netus id lectus velit a

def fib(n):
if n == 0 or n == 1:
return 1
return fib(n-1) + fib(n-2)
def A(n):
if n == 1:
return 1
elif n == 2:
return 4
return A(n-1) + 2*A(n-2)