Questions tagged [numerical-methods]

Questions on numerical methods; methods for approximately solving various problems that often do not admit exact solutions. Such problems can be in various field. Numerical methods provide a way to solve problems quickly and easily compared to analytic solutions.

Filter by
Sorted by
Tagged with
450
votes
7answers
17k views

“The Egg:” Bizarre behavior of the roots of a family of polynomials.

In this MO post, I ran into the following family of polynomials: $$f_n(x)=\sum_{m=0}^{n}\prod_{k=0}^{m-1}\frac{x^n-x^k}{x^m-x^k}.$$ In the context of the post, $x$ was a prime number, and $f_n(x)$ ...
153
votes
2answers
14k views

Proof that ${\left(\pi^\pi\right)}^{\pi^\pi}$ (and now $\pi^{\left(\pi^{\pi^\pi}\right)}$) is a noninteger.

Conor McBride asks for a fast proof that $$x = {\left(\pi^\pi\right)}^{\pi^\pi}$$ is not an integer. It would be sufficient to calculate a very rough approximation, to a precision of less than $1,$ ...
105
votes
24answers
17k views

Why do we still do symbolic math?

I just read that most practical problems (algebraic equations, differential equations) do not have a symbolic solution, but only a numerical one. Numerical computations, to my understanding, never ...
63
votes
3answers
40k views

What algorithm is used by computers to calculate logarithms?

I would like to know how are logarithms calculated by computers. The GNU C library, for example, uses a call to the fyl2x() assembler instruction, which means that ...
63
votes
3answers
2k views

How much does symbolic integration mean to mathematics?

(Before reading, I apologize for my poor English ability.) I have enjoyed calculating some symbolic integrals as a hobby, and this has been one of the main source of my interest towards the vast ...
55
votes
12answers
4k views

What is the fastest/most efficient algorithm for estimating Euler's Constant $\gamma$?

What is the fastest algorithm for estimating Euler's Constant $\gamma \approx0.57721$? Using the definition: $$\lim_{n\to\infty} \sum_{x=1}^{n}\frac{1}{x}-\log n=\gamma$$ I finally get $2$ decimal ...
43
votes
1answer
1k views

Finding $1/x^2 + 1/x^3 + 1/x^5 + \dots $

The following function came up in my work: $$ f(x)=\sum_{p\text{ prime}}\frac{1}{x^p}=\frac{1}{x^2}+\frac{1}{x^3}+\frac{1}{x^5}+\frac{1}{x^7}+\frac{1}{x^{11}}+\cdots. $$ Naturally, this converges for ...
40
votes
7answers
172k views

What’s the difference between analytical and numerical approaches to problems?

I don't have much (good) math education beyond some basic university-level calculus. What do "analytical" and "numerical" mean? How are they different?
39
votes
3answers
2k views

Why does the Mandelbrot set appear when I use Newton's method to find the inverse of $\tan(z)$?

Why does the Mandelbrot set appear when I use Newton's method to find the inverse of $\tan(z)$ Specifically for the equation $y = \tan(z)$ I use Newton's method ($20$ iterations) to solve $0 = \tan(y)...
35
votes
4answers
23k views

Gradient descent with constraints

In order to find the local minima of a scalar function $p(x), x\in \mathbb{R}^3$, I know we can use the gradient descent method: $$x_{k+1}=x_k-\alpha_k \nabla_xp(x)$$ where $\alpha_k$ is the step size ...
34
votes
1answer
842 views

How do I calculate the 2nd term of continued fraction for the power tower ${^5}e=e^{e^{e^{e^{e}}}}$

I need to find the 2nd term of continued fraction for the power tower ${^5}e=e^{e^{e^{e^{e}}}}$ ( i.e. $\lfloor\{e^{e^{e^{e^{e}}}}\}^{-1}\rfloor$), or even higher towers. The number is too big to ...
33
votes
1answer
861 views

Examples of transcendental functions giving almost integers

Informally speaking, an "almost integer" is a real number very close to an integer. There are some known ways to construct such examples in a systematic way. One is through the use of certain ...
32
votes
8answers
19k views

Why does the Newton-Raphson method not converge for some functions?

$f(x)=2x^2-x^3-2$. This is a cubic type graph as shown. The real root of this graph is $(-0.839,0)$. So, the question is to use Newton's approximation method twice to approximate a solution to this $...
32
votes
7answers
26k views

Simple numerical methods for calculating the digits of $\pi$

Are there any simple methods for calculating the digits of $\pi$? Computers are able to calculate billions of digits, so there must be an algorithm for computing them. Is there a simple algorithm that ...
32
votes
4answers
7k views

Why does Monte-Carlo integration work better than naive numerical integration in high dimensions?

Can anyone explain simply why Monte-Carlo works better than naive Riemann integration in high dimensions? I do not understand how chosing randomly the points on which you evaluate the function can ...
32
votes
1answer
1k views

What's the most efficient way to mow a lawn?

For $S\subseteq\Bbb R^2$ and $x\in\Bbb R$, define $E_x(S)=\{y\in\Bbb R^2:d(y,S)<x\}$. ($E_x(S)$ represents the expansion of $S$ by $x$.) Given a path $\gamma:[0,1]\to\Bbb R^2$, denote its length as ...
31
votes
14answers
27k views

How can I calculate $\alpha=\arccos\left(-\frac{1}{4}\right)$ without using a calculator?

How can I calculate $\alpha$, without using a calculator? $\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad$ I know $x = -\frac{1}{4} \implies y= \frac{\sqrt{15}}{4}, $ now how can I calculate $$\...
30
votes
5answers
11k views

How do you calculate the decimal expansion of an irrational number?

Just curious, how do you calculate an irrational number? Take $\pi$ for example. Computers have calculated $\pi$ to the millionth digit and beyond. What formula/method do they use to figure this out? ...
30
votes
4answers
15k views

Why does Newton's method work?

I find many sites explaining how to use Newton's method, but none explaining why it works. Could someone give me the intuition behind it? Thanks.
30
votes
2answers
2k views

Calculating $\lim_{n\to\infty}\sqrt{n}\sin(\sin…(\sin(x)..)$

I was asked today by a friend to calculate a limit and I am having trouble with the question. Denote $\sin_{1}:=\sin$ and for $n>1$ define $\sin_{n}=\sin(\sin_{n-1})$. Calculate $\lim_{n\to\infty}\...
30
votes
4answers
34k views

Recommendations for Numerical Analysis texts?

I'm in a numerical analysis course right now and it's pretty rigorous but I'm enjoying it a lot. I took a lower level course before that was more oriented towards implementation of numerical methods, ...
29
votes
7answers
9k views

Is there a way to find the log of very large numbers?

I should like to evaluate $\log_2{256!}$ or other large numbers to find 'bits' of information. For example, I'd need three bits of information to represent the seven days of the week since $\lceil \...
29
votes
9answers
14k views

Rapid approximation of $\tanh(x)$

This is kind of a signal processing/programming/mathematics crossover question. At the moment it seems more math-related to me, but if the moderators feel it belongs elsewhere please feel free to ...
27
votes
1answer
880 views

Approximate value of a slowly-converging sum of $\sum|\sin n|^n/n$

In this question on Math.SE there appears this sum: $$ S = \sum_{n\geq1}s_n, \qquad s_n = \frac{|\sin n|^n}{n}, $$ which converges very slowly. What methods would you suggest for evaluating it ...
26
votes
6answers
2k views

Why do I get a converging result when pressing cosine multiple times on a calculator? [duplicate]

I'm trying to comprehend the following: If I choose any starting value (e.g. 1) and keep clicking on cosine on the calculator (in radian mode), it gives me a result of about 0.739085...(I believe it's ...
26
votes
4answers
92k views

Help with using the Runge-Kutta 4th order method on a system of 2 first order ODE's.

The original ODE I had was $$ \frac{d^2y}{dx^2}+\frac{dy}{dx}-6y=0$$ with $y(0)=3$ and $y'(0)=1$. Now I can solve this by hand and obtain that $y(1) = 14.82789927$. However I wish to use the 4th order ...
25
votes
6answers
2k views

Why does my calculator show $2^{-329} = 0?$

On my calculator, I usually get a $0$ when I divide something by $2$, a lot of times if that makes sense, but I was just wondering why does $2^{-329} = 0?$
25
votes
3answers
2k views

Influence of small constant term on roots of polynomial

Let $p(x)=a_n x^n + a_{n-1} x^{n-1} + ... + a_1 x + a_0,\enspace a_i\in\mathbb{C}$ some polynomial. Suppose that $|a_0|$ is very small (compared to the other coefficients' magnitude). Is there any ...
25
votes
6answers
18k views

Algorithm to compute Gamma function

The question is simple. I would like to implement the Gamma function in my calculator written in C; however, I have not been able to find an easy way to programmatically compute an approximation to ...
24
votes
1answer
30k views

Explanation and Proof of the fourth order Runge-Kutta method

Runge-Kutte 4th order method is a numerical technique used to solve ordinary differential equation of the form $dy/dx=f(x,y), y(0)=y_0$ It gives $y_{i+1}$ in the form $y_{i+1} = y_i+(a_1k_1+a_2k_2+...
24
votes
5answers
1k views

How could I improve this approximation?

In a computer application, I need to solve trillions of times an equation which can be reduced to $$f(x)=\sin(x)-a x=0$$ Newton methods (quadratic and higher orders) are used for the solution. ...
23
votes
5answers
2k views

Why is it not possible to generate an explicit formula for Newton's method?

Going through the recursive formula for approximating roots every time is extraordinarily tedious, so I was wondering why there was no formula that computed the $n$th iteration of Newton's method.
23
votes
2answers
1k views

How to show that a root of the equation $x (x+1)(x+2) … (x+2009) = c $ can have multiplicity at most 2?

How to show that a root of the equation $$x (x+1)(x+2) ....... (x+2009) = c $$ can have multiplicity at most 2 , and to find the value of $ c $ for which this is possible. I proceeded by using the ...
23
votes
2answers
47k views

How is the Taylor expansion for $f(x + h)$ derived?

According to this Wikipedia article, the expansion for $f(x\pm h)$ is: $$f(x \pm h) = f(x) \pm hf'(x) + \frac{h^2}{2}f''(x) \pm \frac{h^3}{6}f^{(3)}(x) + O(h^4)$$ I'm not understanding how you are ...
22
votes
5answers
4k views

Is there a way to deal with this singularity in numerical integration?

I would like to compute numerically, e.g., using the standard method of trapezes the following definite integral over the interface $[0,1]$: $$ I = \int_0^1 \frac{f(x)}{\sqrt{1-x^2}} \, \mathrm{d} x \,...
22
votes
1answer
644 views

Computing (on a computer) the first few (non-trivial) zeros of the zeta function of a number field

If $K$ is a number field, whose Galois closure over the rationals has degree 24 or so, and whose discriminant is around $163^4$, then what is a numerically efficient way of computing the first few ...
21
votes
7answers
56k views

What is the difference between Finite Difference Methods, Finite Element Methods and Finite Volume Methods for solving PDEs?

Can you help me explain the basic difference between FDM, FEM and FVM? What is the best method and why? Advantage and disadvantage of them?
21
votes
6answers
5k views

Detecting perfect squares faster than by extracting square root

Given the radix-$r$ representation of a integer $n$, and a small integer constant $k$, there is an $O(\log n)$ algorithm for detecting whether $n$ is a multiple of $k$, namely, division, which ...
20
votes
6answers
19k views

Calculate logarithms by hand

I'm thinking of making a table of logarithms ranging from 100-999 with 5 significant digits. By pen and paper that is. I'm doing this old school. What first came to mind was to use $\log(ab) = \log(a)...
19
votes
1answer
627 views

Is this $2020$ holiday formula correct? $\pi\left( \dfrac{\left( \pi!\right)!-\lceil \pi \rceil \pi! }{{\pi}^{\sqrt \pi}-\pi!}\right)=2020$

I found the following formula in another math group: $$\large\color{blue}{\pi\left( \dfrac{\left( \pi!\right)!-\lceil \pi \rceil \pi! }{{\pi}^{\sqrt \pi}-\pi!}\right)=2020}$$ It actually looks very ...
19
votes
2answers
14k views

What is the relationship between cubic B-splines and cubic splines?

What is the relationship between cubic B-splines and cubic splines?
19
votes
4answers
669 views

For which $L^p$ is $\pi=3.2$?

This is a silly question that came to mind after watching numberphile video on How Pi was nearly changed to 3.2. For which $p\in(1,+\infty)$ is the ratio of the perimeter of the $L^p$ disc in $\Bbb R^...
18
votes
4answers
2k views

How do you determine which representation of a function to use for Newton's method?

Take the equation: $$x^2 + 2x = \frac{1}{1+x^2}$$ I subtracted the right term over to form $~f_1(x)~$: $$x^2 + 2x - \frac{1}{1+x^2} = 0$$ I wanted to take the derivative, so I rearranged things ...
18
votes
4answers
13k views

Determining whether a symmetric matrix is positive-definite (algorithm)

I'm trying to create a program, that will decompose a matrix using the Cholesky decomposition. The decomposition itself isn't a difficult algorithm, but a matrix, to be eligible for Cholesky ...
18
votes
2answers
1k views

Wiggly polynomials

I'd like to be able to construct polynomials $p$ whose graphs look like this: We can assume that the interval of interest is $[-1, 1]$. The requirements on $p$ are: (1) Equi-oscillation (or roughly ...
17
votes
5answers
17k views

How to accurately calculate the error function $\operatorname{erf}(x)$ with a computer?

I am looking for an accurate algorithm to calculate the error function $$\operatorname{erf}(x)=\frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}\ dt$$ I have tried using the following formula, (Handbook of ...
17
votes
2answers
2k views

In what sense is the derivative the “best” linear approximation?

I am familiar with the definition of the Frechet derivative and it's uniqueness if it exists. I would however like to know, how the derivative is the "best" linear approximation. What does this mean ...
17
votes
2answers
2k views

Did Feynman mentally compute $\sqrt[3]{1729.03}$ by linear approximation?

In the biopic "infinity" about Richard Feynman. (12:54) He computes $\sqrt[3]{1729.03}$ by mental calculation. I guess that he uses linear approximation. That is, he observe that $1728=12^3$. Let $f(...
17
votes
2answers
4k views

Minimum of the Gamma Function $\Gamma (x)$ for $x>0$. How to find $x_{\min}$?

The $\Gamma (x)$ function has just one minimum for $x>0$ . This result uses some properties of the gamma function: $\Gamma ^{\prime \prime }(x)>0$ and $\Gamma (x)>0$ for all $x>0$ $\Gamma ...
17
votes
5answers
895 views

How to calculate $2^{\sqrt{2}}$ by hand efficiently?

I've been trying to calculate $2^{\sqrt{2}}$ by hand efficiently, but whatever I've tried to do so far fails at some point because I need to use many decimals of $\sqrt{2}$ or $\log(2)$ to get a ...

1 2 3 4 5 211