-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbonusMathFun.Rmd
85 lines (58 loc) · 1.36 KB
/
bonusMathFun.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
title: "Bonus Math - Radical addition"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: scroll
smooth_scroll: true
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Proof
$$\sqrt{x+\sqrt{x+\sqrt{x+\sqrt{...}}}}=x$$
$$x+\sqrt{x+\sqrt{x+\sqrt{...}}}=x^2$$
$$\sqrt{x+\sqrt{x+\sqrt{...}}}=x^2-x$$
$$x=x^2-x$$
$$0=x^2-2x$$
$$0=(x)(x-2)$$
```{r, echo=TRUE}
equation <- function(x, iter) {
if (iter == 0) {
return(sqrt(x))
} else {
return(sqrt(x+equation(x, iter-1)))
}
}
equation(0,100)
equation(2,100)
```
Q.E.D.
Column {data-width=350}
-----------------------------------------------------------------------
### Original Question
<img src="./question2.JPG" width=500 alt="caption" />
```{r}
```
### Experimental Solution
```{r, echo=TRUE}
# equation(0.1,100)
# equation(0.5,100)
equation(1, 100)
```
There is our good friend $$\phi$$ again!
Keep increasing X until we get the answer ...
```{r, echo=TRUE}
equation(1.1, 100)
# ...
# equation(1.8, 100)
# equation(1.99, 100)
equation(2, 100)
```
Make sure it isn't true for any other values higher than 2 ?
```{r, echo=TRUE}
equation(2.1, 100)
equation(3, 100)
```