March 15, 2008 / Pree / 0 Comments

Simpson’s Adaptive Quadrature Algorithm to compute integrals in JAVA for CSC5561 CP2

**In general**

1. procedure integrate ( f , a , b , tau )

2.

3.

4. if e > t then

5. m = (a + b) / 2

6. Q = integrate(f,a,m,tau) + integrate(f,m,b,tau)

7. endif

8. return

**Source code**

Cp2.txt

March 7, 2008 / Pree / 0 Comments

**M**asturbation?? You might think how could I came up with such a nasty word. Well, I don’t know what would be a perfect word to express my feeling when I have to use all my brain cells to memory things before the exam.

From my personal experiences, let me tell you one of the facts about Computer Science students in my University, and count me as one of them. When we take a Math course which is taught by Math professor, we always have a feeling of being dominated by Math/Engineering students and professor. I don’t know why, such that everytime the Math students have to sit in front of the class and nod everything the professor said, while Computer Science students sit at the corner back of the room and crying. It is cruel, the lectures are full of math equations, the homeworks are all about the derivation of math equations, the text book is ten years old and full of math equations in every single pages. About three weeks after attending this class, I have an illusion of mathematics symbols like seeing Integral, summation symbols floating all around me. It is such a nightmare!

I am one of the Computer Science student who never enjoy working with math equation. Also, it has been ages since I have touch Calculus. This evening, for my Communication Networks class, we just had a midterm exam and to be able to kick the math students’s butt, I sacrificed myself three whole days remembering all the needed equations for the the midterm. Some of them I don’t know how to derive so, i just remember them all. When the professor handed the exam to me, I just wrote those ugly equations from my brain cells to the paper as fast as I can before I would forget. The feeling is nuts but it works like a charm, I almost throw up in the exam room…Anyway, the exam went very well. Thanks for all those chocolates, soda, sugar, I injected to myself.