The above is perhaps the best known formula and is also rarely understood. Although the formula for the area of a circle was already known in Ancient Greece, its justification is not easy at all. So it’s a great topic to enrich the “Why?” series.

As you can see above – a square and a circle of the same area are not “somehow intuitively easy” related. Moreover, it has even been shown that squaring a circle (a procedure performed using a compass and a ruler without a scale) is impossible! And here comes the brilliant idea with a rectangle. Before I tell you what it is, let’s take a look at what the π·r² formula really says.

So there are slightly more than 3 squares of the side r in the circle with radius r.

I worked hard on this animation, I hope you like it. Let me know in the comments

Note – the following is not a formal proof, it only illustrates the inference method used by the Ancient Greeks (such as Archimedes’ and determination of the number pi).

It can be seen that the circumference of the regular n-gon circumscribed on the circle is

$$C_n=na$$

and its area is the sum of the areas of the triangles with the base a and the height equal to the circle radius r.

$$A_n=n\frac{ar}{2}=\frac{nar}{2}$$

Substituting

$$A_n=\frac{C_nr}{2}$$

As n gets bigger, Aₙ approximates the circle’s area more and more closely, and Cₙ approximates its circumference. In the “limit step” (infinitesimal) we get the

$$C=\lim C_n=2\pi r$$

$$A=\lim A_n=\lim \frac{C_nr}{2}=\frac{r}{2}\lim C_n=…$$

$$…=\frac{r}{2}C=\frac{r}{2}2\pi r=\pi r^2$$

$$A=\pi r^2$$

The proof I am going to present will not be based on integrating the circle equation. I am going to use sequences and their limits and the squeeze theorem.

Let be given three real sequences aₙ, bₙ, and cₙ. If “almost everywhere” (i.e. omitting at most finite many terms) there is a relation

$$a_n\leq b_n\leq c_n$$

and

$$\lim a_n = \lim c_n = g$$

then

$$\lim b_n = g$$

$$\lim_{x\to 0}\frac{\sin x}{x} = 1$$

I remember from high school, in physics classes, my teacher repeatedly assumed that for small x the function sin (x) can be approximated well by x. It is a results of sin(x) expansion into the Taylor series – let me omit the explanation. However, I will calculate the limit using L’Hôpital’s rule. Later on it is going to be very useful

$$\lim_{x\to 0}\frac{\sin x}{x}=\big(\frac{0}{0}\big)\text{ L’Hôpital’s rule}=$$

$$=\lim_{x\to 0}\frac{(\sin x)\prime}{x\prime}=\lim_{x\to 0}\frac{\cos x}{1}=$$

$$=\frac{\cos 0}{1}=\frac{1}{1}=1$$

$$\lim_{x\to 0}\frac{\sin x}{x} = 1$$

Let us consider regular n-gon circumscribed on a circle and inscribed inside a circle. Let us call “Outer area” the are of the circumscribed n-gon and denote it by Oₙ. Similarly, we will call the inscribed n-gon area as “Inner area”, marking it Iₙ.

Obviously

$$I_n\leq A\leq O_n$$

where A states for the area of a circle.

In the next step, we divide n-gon into n-triangles. Note that in this way the full angle was also divided into n equal parts. The area of the “outer triangle” will be Tₙ and the area of the inner triangle tₙ.

$$O_n=nT_n$$

$$I_n=nt_n$$

**We determine the area of the “outer” triangle by**

$$T_n=Br$$

but

$$\frac{B}{r}=\tan\beta=\frac{\sin\beta}{\cos\beta}$$

$$\frac{B}{r}r^2=r^2\frac{\sin\beta}{\cos\beta}$$

$$Br=r^2\frac{\sin\beta}{\cos\beta}$$

$$T_n=r^2\frac{\sin\beta}{\cos\beta}=r^2\frac{\sin\frac{\pi}{n}}{\cos\frac{\pi}{n}}$$

**We determine the area of the “inner” triangle by**

$$t_n=bh$$

but

$$\frac{b}{r}=\sin\beta$$

$$b=r\sin\beta$$

and

$$\frac{h}{r}=\cos\beta$$

$$h=r\cos\beta$$

substituting

$$t_n=r\sin\beta\cdot r\cos\beta=r^2\sin\beta\cos\beta$$

using trigonometric identities

$$t_n=r^2\sin\beta\cos\beta=\frac{r^2}{2}2\sin\beta\cos\beta=…$$

$$…=\frac{r^2}{2}\sin2\beta=\frac{r^2}{2}\sin\alpha$$

$$t_n=\frac{r^2}{2}\sin\alpha=\frac{r^2}{2}\sin\frac{2\pi}{n}$$

**Final sequences**

$$O_n=nT_n=nr^2\frac{\sin\frac{\pi}{n}}{\cos\frac{\pi}{n}}$$

$$I_n=nt_n=\frac{nr^2}{2}\sin\frac{2\pi}{n}$$

**The limit of Oₙ ad Iₙ**

$$\lim O_n=\lim nr^2\frac{\sin\frac{\pi}{n}}{\cos\frac{\pi}{n}}=$$

$$=\lim \frac{nr^2}{\cos\frac{\pi}{n}}\cdot\frac{\pi}{n}\cdot\frac{\sin\frac{\pi}{n}}{\frac{\pi}{n}}=$$

$$=\lim \frac{\pi r^2}{\cos\frac{\pi}{n}}\cdot\frac{\sin\frac{\pi}{n}}{\frac{\pi}{n}}=\frac{\pi r^2}{\cos 0}\cdot 1=$$

$$=\frac{\pi r^2}{1}=\pi r^2$$

$$\lim O_n=\pi r^2$$

$$\lim I_n=\lim\frac{nr^2}{2}\sin\frac{2\pi}{n}=$$

$$=\lim \frac{nr^2}{2}\cdot \frac{2\pi}{n}\cdot\frac{\sin\frac{2\pi}{n}}{\frac{2\pi}{n}}=$$

$$=\lim \pi r^2\cdot\frac{\sin\frac{2\pi}{n}}{\frac{2\pi}{n}}=\pi r^2\cdot 1=\pi r^2$$

$$\lim I_n=\pi r^2$$

**Final conclusion**

From the squeeze theorem we conclude that the area of the circle is

$$A=\lim O_n=\lim I_n=\pi r^2$$

This is a perfect task for scalar calculator

```
scalar > O(n,r)=n*r^2*sin(pi/n)/cos(pi/n)
scalar > I(n,r)=n/2*r^2*sin(2*pi/n)
scalar > O(3,1)
e1 = 5.196152422706632
scalar > O(7,1)
e2 = 3.371022331652701
scalar > O(20,1)
e3 = 3.1676888064907254
scalar > O(1000,1)
e4 = 3.141602989056156
scalar > I(3,1)
e5 = 1.299038105676658
scalar > I(7,1)
e6 = 2.7364101886381045
scalar > I(20,1)
e7 = 3.090169943749474
scalar > I(1000,1)
e8 = 3.141571982779475
```

**Plus the graph presenting sequences convergence**

```
//The area of a circle.scg
var = n
from = 3
to = 100
miny = pi-0.5
maxy = pi+0.5
exp1 = O(n,1)
exp2 = I(n,1)
exp3 = pi
line1 = 0
line2 = 0
by = 1
curs = 1
```

Take care! Greetings.

I hope I gave you some pleasure ???? with Scalar. Thank you for the 2019. Merry Christmas!

You come from all over the world. I’m very happy about this. Below is a map of people visiting ScalarMath.org.

Click and share ? some good energy with me – simple app rating is the best present I can receive ????

Please share your thought

$$0!=1$$

The assumed value of 1 may seem quite obvious if you consider the recursive formula. However, it did not satisfy me “mathematically”. That’s why I decided to write these few sentences. I will give motivations for the less advanced ones, but there will also be motivations for slightly more insiders.

For integer n > 0 factorial is defined as follows

$$n!=n\times (n-1)\times (n-2)\times \ldots \times 2\times 1$$

With ease you can see that below recursive formula follows

$$n!=n\times (n-1)!$$

$$1!=1$$

Small transformation of

$$n!=n\times (n-1)!$$

gives

$$(n-1)!=\frac{n!}{n}$$

Substituting n = 1

$$(1-1)!=\frac{1!}{1}$$

$$0!=1!=1$$

This explanation, although easy, does not provide (in my opinion) deep enough understanding of “why this should be the best option”.

Let’s assume we have a set containing n elements

$$\{1,2,\ldots,n\}$$

Now let”s count possible ordering of elements is this set

- n ways of selecting first element (because we have the whole set available)
- n-1 ways of selecting second element (because the first was already selected, there are n-1 left)
- n-2 ways of selecting third element (because the two were already selected, there are n-2 left)
- …
- n- (k-1) ways of selecting element number k (because the k-1 were already selected, n- (k-1) remain)
- 2 ways of selecting element number n-1 (because the n-2 were selected, still 2 remain)
- 1 way of selecting element number n (because the n-1 were were selected, remained only one)

Finally, counting all possible ways, we get

$$n\times (n-1)\times (n-2)\times \ldots \times 2\times 1=n!$$

Conclusion: Factorial of n counts the number of permutation of a set containing n elements.

The k-permutations of n are the different ordered arrangements of a k-element subset of an n-set. The number of such k-permutations of n is

$$P_k^n = n\times (n-1)\times (n-2)\times\ldots\times \bigg(n-(k-1)\bigg) = \frac{n!}{(n-k)!}$$

It is easy to see that n-permutation of n is a permutation, so

$$P_n^n=n!$$

$$n! = \frac{n!}{(n-n)!} = \frac{n!}{0!}$$

The next insight why 0!=1 is the correct definition comes from that for any n > 0 we should have

$$0! \times n! = n!$$

Function

$$f:A\to B$$

Function f : A → B, where for every a ∈ A there is f(a) = b ∈ B, defines the relationship between elements a and b. We can say that the elements a ∈ A and b ∈ B are in relation “f” if and only if f(a) = b.

Function is a binary relation, meaning function can be expressed a subset of a Cartesian product.

$$(a,b)\in f \subseteq A\times B \iff f(a)=b$$

Injective function is a function that preserves distinctness: it never maps distinct elements of its domain to the same element of its codomain. Shortly

$$x\neq y \Rightarrow f(x) \neq f(y)$$

A function f is surjective (or onto) if for every element b in codomain, there is at least one element a in the domain such such that f(a)=b . It is not required that x be unique.

$$f:A\to B$$

$${\large \displaystyle\forall_{b \in B} \quad\displaystyle\exists_{a\in A}\quad}f(a)=b$$

Bijective function, or one-to-one correspondence, is a function where each element of one set is paired with exactly one element of the other set, and each element of the other set is paired with exactly one element of the first set. There are no unpaired elements.

In mathematical terms, a bijective function is both injective and surjective mapping of a set A to a set B.

Permutation is a function that returns the order of a set, i.e. if we consider the n-element set {1, 2, …, n} then permutation will be a function

$$p:\{1, 2, …, n\}\to\{1, 2, …, n\}$$

satisfying the bijective function condition.

By asking about the number of permutations we can equally ask about the number of different bijections from a given set into itself.

An empty function is every function whose domain is an empty set.

$$f:\emptyset\to B$$

The empty function “chart” is an empty set, as the Cartesian product of domain and codomain is empty.

$$\emptyset\times B = \emptyset$$

The empty function preserves distinctness (is injective), because in the domain (an empty set) there are no two different elements for which the value of the function is equal.

Let’s analyse the function that maps empty to empty set

$$f:\emptyset\to\emptyset$$

Such a function is a bijection because it is injective function (as shown above) and there is no element in codomain (the codomain is an empty set) that is not in relation to the elements in the domain.

Please note that there is exactly one such a bijection, which is a results of that the function is a subset of the Cartesian product of domain and codomain. In this case this is only one possible set.

$$f:\emptyset\to\emptyset$$

$$\emptyset\times\emptyset = \emptyset$$

The empty set has exactly one subset, which is the empty set – thus such a bijection is uniquely defined.

I wrote above that the number of permutations of an n-element set equals the number of distinct bijective functions from this set into itself.

Following – the permutation of 0-element set corresponds to the bijection from an empty set into the empty set/

The special case of empty function is just 1 – and I presented the proof that there exists only one such a function

Pretty deep insight why 0! should by 1.

In mathematics, the Gamma function is one of the extensions of the factorial function with its argument shifted down by 1, to real and complex numbers.

$$\Gamma(z)=\displaystyle\int_0^{+\infty}t^{z-1}e^{-t}dt$$

After integration by parts we get the recursive formula

$$\Gamma(z+1)=z\cdot\Gamma(z)$$

Let’s see the value of

$$\Gamma(1)=?$$

$$\Gamma(1)=\displaystyle\int_0^{+\infty}e^{-t}dt=\displaystyle\int_{-\infty}^{0}e^{t}dt$$

Following

$$\Gamma(n+1)=n!$$

$$0! = \Gamma(1) = 1$$

Functions in Scalar Calculator, that support Gamma special function

**Gamma(x)**– Gamma special function Γ(s)**sgnGamma(x)**– Signum of Gamma special function, Γ(s)**logGamma(x)**– Log Gamma special function, lnΓ(s)**diGamma(x)**– Digamma function as the logarithmic derivative of the Gamma special function, ψ(x)**GammaL(s,x)**– Lower incomplete gamma special function, γ(s,x)**GammaU(s,x)**– Upper incomplete Gamma special function, Γ(s,x)**GammaP(s,x) , GammaRegL(s,x)**– Lower regularized P gamma special function, P(s,x)**GammaQ(s,x), GammaRegU(s,x)**– Upper regularized Q Gamma special function, Q(s,x)

Based on Taylor series expansion of e^x it is easy to show that

$$e=\displaystyle\sum_{n=0}^\infty\frac{1}{n!}=\frac{1}{0!}+\frac{1}{1!}+\frac{1}{2!}+\frac{1}{3!}+\ldots$$

Thanks for reading! All the best

If you have smiled, please **click the link** and give Scalar some stars – It really helps and makes me smile as well

If you have smiled, please **click the link** and give Scalar some stars – It really helps and makes me smile as well

Scalar implements broad support for the normal distribution:

**pNor(x, mean stdv)**– Probability Distribution Function for normal distribution**cNor(x, mean, stdv)**– Cumulative Distribution Function for normal distribution**rNor(mean, stdv)**– Random numbers generation from normal distribution**[Nor]**– Random variable from N(0,1) normal distribution

Additionally nice function graph example

It is said that multiplication is a short notation of repeated addition, which is absolutely true and, with a limitation to integers, a fairly obvious fact.

**4 × 3 = 3 + 3 + 3 + 3 = 4 + 4 + 4 = 3 × 4 = 12**

These two fundamental multiplication properties can be written as follows

commutative property: **a × b = b × a**

example: **3 × 4 = 4 × 3**

distributive property: **a × (b + c) = a × b + a × c**

example: **3 × 4 = 3 × (1 + 3) = 3 × 1 +3 × 3 = 3 + 9 = 12**

Mathematicians, defining the arithmetic of negative numbers, wanted to be consistent with the already developed arithmetic of positive numbers and zero. Based on the interpretation of the short notation of repeated addition, we can easily justify the following:

**−3 × 4 = (−3) + (−3) + (−3) + (−3) = −12**

“By adding debt to debt,” we get more debt – intuitive. Now using the

commutative property of multiplication we get:

**4 × (−3) = −3 × 4 = −12**

At this point, the intuition is a bit more difficult, but the consistency has been preserved. Time to go to the main point – let’s try to answer the question:

**−3 × (−4) = ?**

To solve the above, we will use a trick based on the distributive property of multiplication over addition.

**−3 × 0 = 0**

**−3 × 0 = −3 × (−4 + 4) = 0**

**−3 × (−4 + 4) = −3 × (−4) + (−3) × 4 = 0**

**−3 × (−4) + (−12) = 0**

**−3 × (−4) = 12**

The above has nothing to do with intuition, but it is consistent, i.e. based on the arithmetic of positive numbers and zero, the commutative property of multiplication, the distributive property of multiplication over addition, we are able to justify why multiplying negative numbers must be a positive number.

Suppose we multiply two numbers, where the interpretation of the first is the value of profit or losses, while the meaning of the second one is the multiplication (increase / decrease) of the first value. In this situation, multiplying two negative numbers means reducing the loss, ie the total positive effect of the action.

profit × increase = positive effect

profit × decrease = negative effect

loss × increase = negative effect

**loss × decrease = positive effect**

The above explanation can be described as intuitive

Finally a video from Mathologer explaining the above problem (that was a base for the above post).

Let’s run the negative numbers multiplication test using the Scalar calculator.

Test fully successful Thank you for reading! All the best

The syntax for defining user functions is as follows.

**FunctionName(param1 <, param2, …>) = expression**

It is much easier to understand this on the basis of an example – it is really easy. Please note that **you can easily define a function depending on the function you have already defined.** It gives you great flexibility.

**Scalar code result:**

scalar > f(x) = sqrt(x) scalar > g(x) = f(x)^2 scalar > h(x) = g(x)^2 scalar > h(4) e1 = 16 scalar > g(4) e2 = 4 scalar > f(4) e3 = 2 scalar > Showing command history

**Scalar script:**

f(x) = sqrt(x) g(x) = f(x)^2 h(x) = g(x)^2 h(4) g(4) f(4)

I am sure, that from time to time, you will want to check what you have already defined. This is possible using context help. Long click on the “example /?” button, then select the user items option.

Each defined function is available in the Scalar namespace. Nothing prevents you from referring to these names anywhere in the application. **In particular, it allows you to draw graphs of your own functions.**

Nothing special in this case as Scalar has no restrictions. Simply use the similar syntax to the presented in the below example.

**Scalar code result:**

scalar > f(x,y) = sin(x) + cos(y) scalar > f(pi/6, pi/4) e1 = 1.2071067811865475 scalar > 1/2 + sqrt(2)/2 e2 = 1.2071067811865475 scalar > f(x,y,z) = x*y*z scalar > f(1,2,3) e3 = 6 scalar > f(4,5,f(1,2,3)) e4 = 120

**Scalar script:**

f(x,y) = sin(x) + cos(y) f(pi/6, pi/4) 1/2 + sqrt(2)/2 f(x,y,z) = x*y*z f(1,2,3) f(4,5,f(1,2,3))

Scalar provides a special syntax for defining functions with **any (variable) number of parameters.**

**FunctionName(…) = expression**

**“(…)”** is obligatory as it indicates that you create function with variable number of parameters.

**Additionally Scalar provides special keywords that help to build expression defining variadic functions.**

**[npar]**– number of parameters provided by the user on calculation request**par(i)**– value of parameter at index “i”

Please refer to the below example

**Scalar code result:**

scalar > f(...) = [npar] scalar > f(2) e1 = 1 scalar > f(3,1) e2 = 2 scalar > f(4,2,5,6) e3 = 4 scalar > f(...) = sum(i,1,[npar],par(i)) scalar > f(1,2,3,4,5) e4 = 15 scalar > 1+2+3+4+5 e5 = 15

**Scalar script:**

f(...) = [npar] f(2) f(3,1) f(4,2,5,6) f(...) = sum(i,1,[npar],par(i)) f(1,2,3,4,5) 1+2+3+4+5

Thank you for your time

All the bets!

**In Scalar you can simply write x = 2, y = 2 * x**, etc. Try it yourself. Pay particular attention to the fact that when defining the argument y, which depends on the argument x, the change in the value of x affects the value of y. In other words, Scalar remembers the expressions that define the arguments and uses these expressions at the time of requesting the value.

**Scalar code result:**

scalar > x = 2 scalar > x e1 = 2 scalar > 2*x + 4 e2 = 8 scalar > y = 2*x + 4 scalar > y e3 = 8 scalar > x = 3 scalar > y e4 = 10

**Scalar script:**

x = 2 x 2*x + 4 y = 2*x + 4 y x = 3 y

In terms of dependencies between arguments Scalar does not define any restrictions. You can create wide and deep dependency trees. This is well illustrated by the example below.

**Scalar code result:**

scalar > a = 3 scalar > b = 3*a + 2 scalar > c = a*b scalar > d = a + b + c scalar > d e1 = 47 scalar > a = 4 scalar > d e2 = 74 scalar > a = 5 scalar > d e3 = 107

**Scalar script:**

a = 3 b = 3*a + 2 c = a*b d = a + b + c d a = 4 d a = 5 d

In certain situations, it is convenient to check how user elements are defined. Use the list command to do this.

**list**

Please note that Scalar assigns the results of the calculations to the constant, while the arguments are marked separately.

**Scalar code result:**

scalar > list Type Name/Value ---- ---------- Constant: e1 = 47.0 ----- d Constant: e2 = 74.0 ----- d Constant: e3 = 107.0 ----- d Argument: a = 5.0 ----- a = 5 Argument: b = 17.0 ----- b = 3*a + 2 Argument: c = 85.0 ----- c = a*b Argument: d = 107.0 ----- d = a + b + c

**Scalar script:**

list

You can also use context help to verify the elements definition. Long click on the “example /?” button, then in the dialog select the user items.

The difference between the user constant and the user argument is fundamental. T**he constant only remembers the value, the argument remembers the expression, thanks to which the value can be calculated. **You can define your own constant by adding the const command at the beginning.

**const **def

**Scalar code result:**

scalar > x = 3 scalar > const y = x^2 scalar > y e1 = 9 scalar > x = 10 scalar > y e2 = 9 scalar > list Type Name/Value ---- ---------- Constant: y = 9.0 ----- y = x^2 Constant: e1 = 9.0 ----- y Constant: e2 = 9.0 ----- y Argument: x = 10.0 ----- x = 10

**Scalar script:**

x = 3 const y = x^2 y x = 10 y list

It’s all for today. Thank you

The most frequently used numbers are 2 and 5. It is also well visible the effect of multi-use of the digit 0 considering particular user perspective. The digit, that is used the least often, is 7.

Digit | Clicks [%] | Users [%] |

0 | 12.8% | 7.8% |

1 | 12.5% | 11.0% |

2 | 17.5% | 16.0% |

3 | 11.3% | 12.0% |

4 | 6.5% | 8.0% |

5 | 15.3% | 14.4% |

6 | 9.9% | 10.7% |

7 | 3.9% | 6.1% |

8 | 5.3% | 7.3% |

9 | 5.1% | 6.6% |

Sequence: 2, 5, 0, 1, 3, 6, 4, 8, 9, 7

Digit | Clicks [%] | Users [%] |

2 | 17.5% | 16.0% |

5 | 15.3% | 14.4% |

0 | 12.8% | 7.8% |

1 | 12.5% | 11.0% |

3 | 11.3% | 12.0% |

6 | 9.9% | 10.7% |

4 | 6.5% | 8.0% |

8 | 5.3% | 7.3% |

9 | 5.1% | 6.6% |

7 | 3.9% | 6.1% |

Sequence: 2, 5, 3, 1, 6, 4, 0, 8, 9, 7

Digit | Clicks [%] | Users [%] |

2 | 17.5% | 16.0% |

5 | 15.3% | 14.4% |

3 | 11.3% | 12.0% |

1 | 12.5% | 11.0% |

6 | 9.9% | 10.7% |

4 | 6.5% | 8.0% |

0 | 12.8% | 7.8% |

8 | 5.3% | 7.3% |

9 | 5.1% | 6.6% |

7 | 3.9% | 6.1% |

By removing the digits 0 and 3, we get the same order in terms of per clicks and per users perspectives.

Sequence position | Digits by Clicks | Digit by Users |

1 | 2 | 2 |

2 | 5 | 5 |

3 | 0 | 3 |

4 | 1 | 1 |

5 | 3 | 6 |

6 | 6 | 4 |

7 | 4 | 0 |

8 | 8 | 8 |

9 | 9 | 9 |

10 | 7 | 7 |

Interesting! All the best!