Skip to main content

Questions tagged [approximation]

For challenges relating to approximating a value, typically a constant or something related to the program's input

19 votes
17 answers
2k views

Each element on the periodic table of the elements has an atomic weight. For example, boron (element 5) has an atomic weight of 10.81. Your challenge is to write a program which takes as input the ...
Ginger's user avatar
  • 6,146
28 votes
55 answers
4k views

We all know that the Euler's number, denoted by \$e\$, to the power of some variable \$x\$, can be approximated by using the Maclaurin Series expansion: $$e^x=\sum_{k=0}^{\infty}{\frac{x^k}{k!}}=1+x+\...
Meow Mix's user avatar
  • 933
22 votes
11 answers
3k views

This challenge was inspired by this non-challenge about the natural logarithm base \$e\$ and the following pandigital approximation to \$e\$ appearing on a Math Magic page: $$\left|(1+9^{-4^{7×6}})^{3^...
Parcly Taxel's user avatar
  • 4,749
49 votes
22 answers
6k views

You'll be given the name of one of the 20 biggest objects in the Solar System. Your task is to return an approximation of its radius, expressed in kilometers. This is a code-challenge where your ...
Arnauld's user avatar
  • 207k
19 votes
67 answers
11k views

The Challenge You must calculate pi in the shortest length you can. Any language is welcome to join and you can use any formula to calculate pi. It must be able to calculate pi to at least 5 decimal ...
poseidon's user avatar
  • 387
26 votes
25 answers
3k views

The Dottie number is the fixed point of the cosine function, or the solution to the equation cos(x)=x.1 Your task will be to make code that approximates this constant. Your code should represent a ...
Wheat Wizard's user avatar
  • 104k
38 votes
23 answers
4k views

Goal Create a program/function that takes an input N, check if N random pairs of integers are relatively prime, and returns <...
NonlinearFruit's user avatar
28 votes
35 answers
4k views

Happy Pi Day everyone! For no reason at all, I'm trying to construct a Monte Carlo estimator of Pi that is as short as possible. Can we construct one that can fit in a tweet? To clarify, what I have ...
keegan's user avatar
  • 417
14 votes
13 answers
2k views

Challenge Given a number x and a precision e, find the lowest positive integer q such that <...
Stef's user avatar
  • 997
27 votes
19 answers
2k views

Brun's constant is the value to which the sum of the reciprocals of twin prime pairs (1/p and 1/(p+2) where ...
user avatar
26 votes
17 answers
2k views

Khinchin's constant is a curious mathematical constant that, according to Wolfram MathWold, is "notoriously difficult to calculate to high precision". Here it is to 100 digits: 2....
Calvin's Hobbies's user avatar
29 votes
9 answers
3k views

A mortality table or life table is an actuarial tool that gives the probability that a person aged \$A\$ years will die in the next year, and is used to help calculate the premiums for life insurance, ...
Giuseppe's user avatar
  • 29.6k
4 votes
22 answers
2k views

Task Given a number between 0 and 1 and another integer, print the approximated value of the first number rounded off to the specified number of digits given by the second integer. For example, if ...
Luc H's user avatar
  • 559
21 votes
18 answers
5k views

Introduction: The sine of \$x\$ is given by the formula: $$\sin(x) = x - \frac {x^3}{3!} + \frac {x^5}{5!} - \frac {x^7}{7!} + \frac {x^9}{9!} - \frac {x^{11}}{11!} + \cdots$$ The cosine of \$x\$ is ...
Gaurang Tandon's user avatar
10 votes
19 answers
1k views

Inspired by this video by tecmath. An approximation of the square root of any number x can be found by taking the integer square root ...
Stan Strum's user avatar

15 30 50 per page