## Computer Science and Calc 1

A place to discuss the science of computers and programs, from algorithms to computability.

Formal proofs preferred.

Moderators: phlip, Moderators General, Prelates

mountaingoat
Posts: 80
Joined: Wed Aug 01, 2007 6:01 am UTC

### Computer Science and Calc 1

I'm taking Calc AB (also dual-enrollment) and for our final our teacher is making us do a project that has something do with Calculus.

What can I do that's related to Computer Science but not too difficult?

I was thinking of something like Big O notation, but that's not specifically calculus based. It'd be nice if derivatives/integrals were used somewhere in the project...

Posts: 687
Joined: Mon May 05, 2008 2:14 am UTC

### Re: Computer Science and Calc 1

You might look at topics in the Numerical Methods field.

This includes algorithms to approximate the derivatives of functions, find roots of functions, etc.

Basically, algorithms that try to determine the properties of continuous functions computationally instead of analytically.

http://en.wikipedia.org/wiki/Numerical_methods

darren
Posts: 188
Joined: Fri Feb 08, 2008 5:37 pm UTC

### Re: Computer Science and Calc 1

Last edited by darren on Tue Sep 09, 2008 12:28 am UTC, edited 1 time in total.

mountaingoat
Posts: 80
Joined: Wed Aug 01, 2007 6:01 am UTC

### Re: Computer Science and Calc 1

Hm, those are both great suggestions, thanks!

Quick too.

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Contact:

### Re: Computer Science and Calc 1

Another fun one would be a program that given an expression as input (e.g. sin x * x^2) and a variable, returns the derivative of the expression with respect to that variable.

qbg
Posts: 586
Joined: Tue Dec 18, 2007 3:37 pm UTC

### Re: Computer Science and Calc 1

EvanED wrote:Another fun one would be a program that given an expression as input (e.g. sin x * x^2) and a variable, returns the derivative of the expression with respect to that variable.

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Contact:

### Re: Computer Science and Calc 1

qbg wrote:
EvanED wrote:Another fun one would be a program that given an expression as input (e.g. sin x * x^2) and a variable, returns the derivative of the expression with respect to that variable.

"Too easy" depends on how much they've covered. If you have to learn how to write a lexer and parser first, it could easily become a reasonable project. I think we talked about it a tiny bit in my AB class a few years ago, but not enough to do this.

And I would expect at least simple simplifications; constant folding, multiplications by 1, additions of 0, and maybe folding of like terms (5x + 3x).

skeptical scientist
closed-minded spiritualist
Posts: 6142
Joined: Tue Nov 28, 2006 6:09 am UTC
Location: San Francisco

### Re: Computer Science and Calc 1

Little o notation uses limits, and I think it shows up in computer science some. Examples of determining little o relationships frequently use l'Hopital's rule. (One can also use l'Hopital's rule to prove various big-O asymptotics.)

You can also combine calculus and big O notation, and prove things like
$\sum_{n=1}^N \frac{1}{n} = O(\ln N)$
or
$n! = \sqrt{2 \pi n}~{\left( \frac{n}{e} \right)}^n \left( 1 + O \left( \frac{1}{n} \right) \right)$
(Stirling's approximation).
I'm looking forward to the day when the SNES emulator on my computer works by emulating the elementary particles in an actual, physical box with Nintendo stamped on the side.

"With math, all things are possible." —Rebecca Watson