$f(x,t) = \sqrt{\frac{30}{a}}\left(\frac{2}{\pi}\right)^3 \sum_{n=1,3,5,...} \frac{1}{n^3} cos(n\pi x/a)cos(\frac{n^2 \pi^2 t }{2a^2})$
$g(x,t) = \sqrt{\frac{30}{a}}\left(\frac{2}{\pi}\right)^3 \sum_{n=1,3,5,...} \frac{1}{n^3} sin(n\pi x/a)cos(\frac{n^2 \pi^2 t }{2a^2})$
$h(x,t) = \left(f(x,t)\right)^2+\left(g(x,t)\right)^2$
Use a for loop to get the sum within the animate function and plot(animate) this function.
Try for different numberof terms. Say, first 10 term then do it for first 20 terms and so on!
Suppose, you have a very durable glass ball. You want to test the hardness by dropping it from different floors of a building. If a ball falls from n-1tℎ floor and stays intact, then, we need to climb up and drop it again. Now, if we drop it from the nth floor and it breaks apart, we will define n as the quality factor of that glass ball.
First store a random integer(take a range of 1 to 100), which will be the quality factor of the ball.
Now design a program which will search for that n and will give you the correct output and number of iteration it took to found the correct value. For a naive solution It will take n number of iterations to find the correct value.
Now optimize your code in such a way that the program can find n by using k iterations where k is very less than n. (n>k>=log(n)/log2) p.s; We are rich now., so, instead of using a single ball, now we can afford to break k balls (At MOST).
Ohkay! The number of balls you have wasted in the last round have made us bankrupt and we only have two balls(No Pun Intended) which were left behind by the authorities. Solve the given problem using m number of iterations such that, m<n/2
Solve the given problem using no balls.
Find an algorithm which can help us to clean the shattered glassballs from the mXn floor. It should be done using atmost max(m,n) steps.
You may look at here for the solution: https://commandantekaustav.github.io/algo/prob/algorithmic%20problems.html (in C++)