Links | Octave | R | TI Calculator | Maxima | WolframAlpha | GeoGebra | Sage | Latex

Sage, CoCalc

numerical approximation2*pi.n()
2*pi.n(digits=50)
show it prettyshow(expand((x+5)^2))
derivativevar('x y')
f(x,y) = 5*x^3*y^2
diff(f,x,y).substitute(x=-1,y=5)

Markdown / Latex

headings# section
## subsection
images<img src="url or filename" width=200>
links<url>
<a href="url">text</a>
new line(double space)
italic*text*
bold**text**
strike-out~~text~~
horizontal line---
color<span style='color:green'>green text</span>
lists
- animals
  1. zebra
  2. yak
- minerals
  1. calcium
  2. sodium
table
| Col1         | Col2     | Col3          |
| :----------- | :------: | ------------: |
| Left-aligned | Centered | Right-aligned |
| blah         | blah     | blah          |
source codeinline `like this`, or for a block:
```
  int x=1
  for (int i=1;i<=10;i++)
    x += i;
  printf("%d\n",x)
```
block quote sectionsprefix with "> "
> this section will be set apart
> from the surrounding material
fraction$\frac{ x+2 }{ x^2+1 }$
subscript and superscript$x_a^{12}$
functions$\sqrt{x} , \sqrt[3]{x}, \cos(x), \ln(x), \min(x), \| \cdot \|$
greeks$\alpha, \beta, \pi, \sigma, \Sigma$
hats$\hat{x} , \tilde{x}$
integral symbol$\int , \iint , \oint$
misc symbols$\neq, \leq, \times, \rightarrow, \nabla, \pm, \subset, \cdots, \exists, \forall, \heartsuit$
limits$$\lim_{n \rightarrow \infty} \left( 1+\frac{1}{n} \right)^n = e$$
derivatives$\frac{dy}{dx}$
$\frac{\partial y}{\partial x}$
matrix$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$

Octave

What is Octave?

Matlab has become a standard in scientific computing. It is a high-level numerical computing language, and can be used as both a programming language and command-line driven calculator. Matrices are the basic objects of computation.

Matlab is proprietary software, and can be quite expensive for some of the more state-of-the-art special toolboxes. Octave is a free and open-source clone of Matlab. It has essentially the same syntax and functionality, but is open-source and free!

Reference Links

Installing Octave

Octave is installed on selected lab computers, but you are strongly encouraged to install this software on your own PC.
  1. Download the installer and save it to your Desktop.
  2. Double-click on the file you just downloaded to begin the installer.
  3. Agree to the license and all default settings.
  4. Your install is now complete, and you should have a shortcut to Octave on your desktop and in your start menu. You can delete the original installer.

Matlab/Octave Quick Introduction

The Matlab user environment is just a plain console, where you can type commands and receive answers. Think of it as a specialized calculator, with the power to solve much larger and varied types of problems. Use the resource links above, in conjunction with the built-in 'help' command to see how a particular function works. The examples below will demonstrate some basic Matlab commands; you should experiment with them on your own.
  • The up/down arrows conveniently allow you to scroll between previous commands.
  • Put a semicolon at the end of a command to suppress output.
  • Variables are case-sensitive.
  • The example commands/output below should be self-explanatory.

>> A=[1 5 0 1000; 0 -3 1 200; 1 0 -1 0]
A =
         1         5         0      1000
         0        -3         1       200
         1         0        -1         0

>> size(A)
ans =
        3        4

>> A(1,4)
ans = 1000

>> A(2,:)
ans =
         0        -3         1       200

>> A(:,2)
ans =
         5
        -3
         0

>> B=A(1:3,1:3)
B =
         1         5         0
         0        -3         1
         1         0        -1

>> B'
ans =
         1         0         1
         5        -3         0
         0         1        -1


>> A([2,3],:)=A([3,2],:)
A =
         1         5         0      1000
         1         0        -1         0
         0        -3         1       200

>> rref(A)
ans =
        1        0        0      500
        0        1        0      100
        0        0        1      500
>> A\b
ans = 
      500
      100
      500

>> inv(A)*b
ans = 
      500
      100
      500
sum a series

S=0; for k=1:100,   S = S + 1/k;   end; S
recursive sequence

B=[0];
for k=1:40
  B(end+1) = 1.05*B(end) + 5500; 
end
printf("%2d %12.2f\n",[0:40;B]);
plot(0:40,B,'+')
plot contours/surfacex = -8:.1:8;
y = -8:.1:8;
[X,Y]=meshgrid(x,y);
Z = sin(sqrt(X.^2+Y.^2)) ./ sqrt(X.^2+Y.^2);
mesh(Z);
contour(Z);
meshc(Z);

R Statistics Software

What is R?

R is a free open-source statistical software package. Think of it as a calculator on steroids. It has a command-line interface, and can serve as a programming language. It can do simulations, graphs, and analysis on data that you enter yourself, or download from the web.

References

Installing R

R is installed on selected lab computers, but you are strongly encouraged to install this software on your own PC.
  1. Download the exe file and save it to your Desktop.
  2. Double-click on the file you just downloaded to begin the installer.
  3. Agree to the license and all default settings.
  4. Your install is now complete, and you should have a shortcut to R on your desktop and in your start menu. You can delete the original installer.
  5. If you use a Mac or Linux, you can find install info here.

R Quick Introduction

  • These commands illustrate some basic R functionality.
  • The up/down arrows conveniently allow you to scroll between previous commands.
  • Put a semicolon at the end of each command.
  • Variables names are case-sensitive.
  • A data set may have multiple columns - to access one column use "datasetName$columnName"

q(); quit R
ctime = c(10,45,5,10,7,7);define data set vector
ctime; show the data set
length(ctime); length of the data set
class = read.table("m:/m201/class.txt",header=T); read data set as a table from a file
summary(class$siblings); 1-var summary data
sd(class$siblings); standard deviation
stem(class$shoe); stem and leaf plot
barplot(table(class$siblings)); histogram
hist(class$shoe,freq=F); histogram of quantitative data
boxplot(class$shoe); boxplot
boxplot(class$shoe ~ class$gender); parallel boxplots
seq(1,100,2) list 1 to 100 by 2's
sample(1:30, 7); sample without replacement
sample(1:30, 7, replace=T); sample with replacement
rnorm(10, mean=100, sd=15); sample from normal distribution
x = matrix( sample(1:0,7*20, replace=T, c(.6,.4)), ncol=7);
totals = rowSums(x);
simulate binomial (20 sims, n=7, p=.6)
n = 6; sims = 100;
x = matrix( rexp(n*sims, 1/4), ncol=n);
sampleMeans = rowSums(x) / n;
simulate sampling dist of xbar
prop.test(30, 50, p=.5, conf.level=.95, alternative="two.sided") one sample proportion test
t.test(class$shoe, mu = 10, conf.level=.95, alternative="two.sided") t-test on sample mean

TI 83/84 Calculator

enter dataSTAT-EDIT; fill in data vals in L1, and optionally frequency in L2
restore lost listSTAT-5-ENTER
One variable summarySTAT-CALC, 1VarStats L1 (,L2)
factorial5 [[math , prb , ! ]]
permuation5 [[ math, prb, nPr ]] 2
combination5 [[ math, prb, nCr ]] 2
binomial for exactly xbinompdf(n, p, x)
binomial for less than or equal to xbinomcdf(n, p, x)
full binomial distributionbinompdf(n,p) [ -> L2 ]
normal for x between a and bnormalcdf(a,b,mu,sigma) (use +/- E99 for infinity)
normal distribution, given a percentile area A, find xinvnorm(A,mu,sigma)
conf int / hyp test for proportionSTAT-TESTS-1-PropZInt/Test
conf int / hyp test for sample meanSTAT-TESTS-TInterval/Test
conf int / hyp test for 2-sample proportionSTAT-TESTS-2-PropZInt/Test
conf int / hyp test for 2-sample meanSTAT-TESTS-2-SampTInt/Test
hyp test for standard deviationsSTAT-TESTS-2-SampFTest
linear regression / correlationenter data in L1,L2, and then STAT-TESTS-LinRegTTest
ANOVAenter data in L1,L2,L3,etc, and then STAT-TESTS-ANOVA(L1,L2,L3)
chi-squared test for independenceenter contingency table in MATRIX-EDIT, then STAT-TESTS-chi^2

Maxima

submit commands for processingshift-enter
define a functionf(x):=x^2; f(2);
make a sequencemakelist([n,1/n],n,1,10);
find a limitlimit((n+1)/n,n,inf);
Taylor seriestaylor(exp(x), x, 0, 8);
parametric plotplot2d ([parametric, cos(t), sin(t), [t, 0, 2*%pi], [nticks,100]]);
parametric plotload(draw);
draw2d(parametric(cos(t),sin(t),t,0,2*%pi));
draw3d(parametric(cos(t),sin(t),t,t,0,2*%pi));
animated plotload(draw);
r(t):=[cos(t),sin(t)];
Tmin:0; Tmax:4*%pi; n:50;
with_slider_draw(
T, makelist(Tmin+i*(Tmax-Tmin)/n,i,0,n),
xrange = [-2,2], yrange = [-2,2],grid=true,dimensions=[600,500],
label([printf(false,"t=~8,3f",T),0,0]),
parametric(r(t)[1],r(t)[2],t,0,T) ,
point_size=2,point_type=filled_circle,color=red, points([r(T)]) );
3d surface plotload(draw);
draw3d(enhanced3d=true,surface_hide=true,xu_grid=50,yv_grid=50,xlabel="x",ylabel="y",
contour_levels=10,contour=base,explicit(sin(x*y),x,-2,2,y,-2,2));
vector valued functions
load(eigen);
load(vect);
r(t):=[sin(t), cos(t), t];
define(v(t), diff(r(t),t) );
define(speed(t), sqrt(v(t).v(t)) );
define(T(t), unitvector(v(t)) );
define(a(t), diff(v(t),t) );
define(Tprime(t), diff(T(t),t) );
define(N(t), unitvector(Tprime(t)) );
define(aT(t), diff(speed(t),t));
define(aN(t), sqrt(a(t).a(t) - aT(t)^2) );
define(kurv(t), aN(t) / (v(t).v(t)) );
define(R(t), 1/kurv(t) );
define(B(t), express(T(t)~N(t)) );
float(v(1));
float(a(1));
float(aT(1)*T(1) + aN(1)*N(1));
Lagrange multipliers
f(x,y):=x^2+2*y^2;
g(x,y):=y-x^2+4;
solns:solve( [ diff(f(x,y),x)-L*diff(g(x,y),x), diff(f(x,y),y)-L*diff(g(x,y),y), 
               g(x,y)], [x,y,L])$
for soln in solns do (
  print(soln," f=",float(ev(f(x,y),soln))) );
Milk-maid problem
load(draw)$
load(mnewton)$
f(x,y):=sqrt((x+1)^2+y^2)+sqrt((x-1)^2+y^2);
g(x,y):=(x^2+3*y-6)*(y-2)-3*x;
x0:-2; x1:2; y0:-2; y1:4;
draw2d(  grid = true, color = black,
    point_size = 5,point_type = filled_square, points([ [-1,0], [1,0] ]),
    color = blue,line_width = 4, implicit(g(x,y) = 0,x,x0,x1,y,y0,y1),
    line_width=2,
    color = red,         implicit(f(x,y)=2.03,x,x0,x1,y,y0,y1),
    color = orange,      implicit(f(x,y)=2.1,x,x0,x1,y,y0,y1),
    color = purple,      implicit(f(x,y)=2.5,x,x0,x1,y,y0,y1),
    color = forest_green,implicit(f(x,y)=3,x,x0,x1,y,y0,y1),
    color = brown,       implicit(f(x,y)=3.5,x,x0,x1,y,y0,y1),
    color = pink,        implicit(f(x,y)=4,x,x0,x1,y,y0,y1) 
)$
soln:mnewton([ g(x,y), diff(f(x,y),x)-L*diff(g(x,y),x), diff(f(x,y),y)-L*diff(g(x,y),y) ], [x,y,L], [1,.5,0]);
ev(f(x,y),soln);

Wolfram Alpha


GeoGebra