Skip to content

Instantly share code, notes, and snippets.

View JaneLSumner's full-sized avatar

Jane S. JaneLSumner

View GitHub Profile
@JaneLSumner
JaneLSumner / sequences-and-convergence.R
Created December 15, 2015 20:31
A quick R code demonstrating some of the logic behind sequences and convergence of sequences.
### Sequences and Convergence
### Jane Lawrence Sumner
### POLS 508
### Dec. 15, 2015
##### Here are the functions that make the thing work. Scroll down for examples.
fxn <- function(x){
fx <- (x+1)/x ## function goes here
return(fx)
}
@JaneLSumner
JaneLSumner / delta-epsilon-proof.R
Last active October 17, 2015 15:52
This code is intended to allow students to visualize the logic behind the delta-epsilon proof of limits. It was written for Political Science 508, a mandatory course for first-semester political science Ph.D. students at Emory University, by Jane Lawrence Sumner.
## The Logic Behind Epsilon-Delta Proof (graphically)
## Jane Lawrence Sumner
## TA: POLS 508, Fall 2015
### CAUTION: THIS IS NOT A PROOF. THIS IS NOT RIGOROUS. THIS IS JUST MEANT ###
### TO SOLIDIFY THE LOGIC BEHIND THE METHOD IN YOUR BRAIN. THIS IS JUST A ###
### TOY. PLAY AROUND WITH IT. GET THE LOGIC DOWN. THEN SOLVE IT ANALYTICALLY. ###
## (you can ignore this. this function just lets me generate the same
@JaneLSumner
JaneLSumner / mean-value-theorem.R
Last active October 17, 2015 15:50
This code is intended to allow students to visualize the logic behind the mean value theorem. It was written for Political Science 508, a mandatory course for first-semester political science Ph.D. students at Emory University, by Jane Lawrence Sumner.
#Understanding the Mean Value Theorem
#POLS 508, Fall 2015
#TA: Jane Lawrence Sumner
# The Mean Value Theorem states that if the function is continuous on the closed
# interval and differentiable on the open interval, then there exists a point c
# at which the tangent to that point is parallel to the secant.
## In other words, there exists a point c such that f'(c)=(f(b)-f(a))/(b-a)
@JaneLSumner
JaneLSumner / visualizing-riemann.R
Last active October 17, 2015 15:50
This code is intended to allow students to visualize the logic behind calculating definite integrals using the limit of a Riemann sum. It was written for Political Science 508, a mandatory course for first-semester political science Ph.D. students at Emory University, by Jane Lawrence Sumner.
## Definite Integral as the Limit of a Riemann Sum: Visualizing the Logic
## Jane Lawrence Sumner
## TA, POLS 508, Fall 2015
#### INPUTS HERE ####
a <- 1 ## lower bound
b <- 10 ## upper bound
n <- 20 ## number of iterations