昨天看到一句話物邑,斐波那契數(shù)列的第50個(gè)數(shù)字是多少溜哮?我直覺(jué)大概幾萬(wàn)吧。然后就打開(kāi)R算了下究竟是多少拂封,看完我有點(diǎn)吃驚了茬射,讓我想起了國(guó)王的麥粒。
往下看之前冒签,你也可以先自己猜測(cè)下大概是多少在抛。
1 斐波那契數(shù)列的第50個(gè)數(shù)是多少
output <- vector("numeric", 50)
for (i in 3:50) {
output[1] = 1
output[2] = 1
output[i] = output[i-1]+output[i-2]
}
output
> output
[1] 1 1 2 3 5 8 13 21
[9] 34 55 89 144 233 377 610 987
[17] 1597 2584 4181 6765 10946 17711 28657 46368
[25] 75025 121393 196418 317811 514229 832040 1346269 2178309
[33] 3524578 5702887 9227465 14930352 24157817 39088169 63245986 102334155
[41] 165580141 267914296 433494437 701408733 1134903170 1836311903 2971215073 4807526976
[49] 7778742049 12586269025
接近126億!有沒(méi)有出乎你的意料?
然后突然又想起來(lái)之前看過(guò)的一句話萧恕,類似復(fù)利刚梭,是關(guān)于進(jìn)步的肠阱。假如每天進(jìn)步一點(diǎn)點(diǎn),比如0.01朴读,雖然具體數(shù)字無(wú)法度量屹徘,但我們每天的進(jìn)步自己是可以感覺(jué)到了。那365天會(huì)進(jìn)步多少衅金?反之噪伊,每天退步0.01,365天之后呢?
2 每天進(jìn)步一點(diǎn)點(diǎn)或者退步一點(diǎn)點(diǎn)(0.01)
forward_alittle <- vector("numeric")
backward_alitter <- vector("numeric")
for (i in 1:365) {
rate = 0.01
forward_alittle[1] = 1
forward_alittle[i] = (1+rate)^i
backward_alitter[1] = 1
backward_alitter[i] = (1-rate)^i
}
forward_alittle
backward_alitter
> forward_alittle
[1] 1.000000 1.020100 1.030301 1.040604 1.051010 1.061520 1.072135 1.082857 1.093685 1.104622 1.115668 1.126825 1.138093
[14] 1.149474 1.160969 1.172579 1.184304 1.196147 1.208109 1.220190 1.232392 1.244716 1.257163 1.269735 1.282432 1.295256
[27] 1.308209 1.321291 1.334504 1.347849 1.361327 1.374941 1.388690 1.402577 1.416603 1.430769 1.445076 1.459527 1.474123
[40] 1.488864 1.503752 1.518790 1.533978 1.549318 1.564811 1.580459 1.596263 1.612226 1.628348 1.644632 1.661078 1.677689
[53] 1.694466 1.711410 1.728525 1.745810 1.763268 1.780901 1.798710 1.816697 1.834864 1.853212 1.871744 1.890462 1.909366
[66] 1.928460 1.947745 1.967222 1.986894 2.006763 2.026831 2.047099 2.067570 2.088246 2.109128 2.130220 2.151522 2.173037
[79] 2.194768 2.216715 2.238882 2.261271 2.283884 2.306723 2.329790 2.353088 2.376619 2.400385 2.424389 2.448633 2.473119
[92] 2.497850 2.522829 2.548057 2.573538 2.599273 2.625266 2.651518 2.678033 2.704814 2.731862 2.759181 2.786772 2.814640
[105] 2.842787 2.871214 2.899927 2.928926 2.958215 2.987797 3.017675 3.047852 3.078330 3.109114 3.140205 3.171607 3.203323
[118] 3.235356 3.267710 3.300387 3.333391 3.366725 3.400392 3.434396 3.468740 3.503427 3.538461 3.573846 3.609585 3.645680
[131] 3.682137 3.718959 3.756148 3.793710 3.831647 3.869963 3.908663 3.947749 3.987227 4.027099 4.067370 4.108044 4.149124
[144] 4.190616 4.232522 4.274847 4.317595 4.360771 4.404379 4.448423 4.492907 4.537836 4.583215 4.629047 4.675337 4.722091
[157] 4.769311 4.817005 4.865175 4.913826 4.962965 5.012594 5.062720 5.113347 5.164481 5.216126 5.268287 5.320970 5.374180
[170] 5.427921 5.482201 5.537023 5.592393 5.648317 5.704800 5.761848 5.819466 5.877661 5.936438 5.995802 6.055760 6.116318
[183] 6.177481 6.239256 6.301648 6.364665 6.428311 6.492594 6.557520 6.623096 6.689326 6.756220 6.823782 6.892020 6.960940
[196] 7.030549 7.100855 7.171863 7.243582 7.316018 7.389178 7.463070 7.537701 7.613078 7.689208 7.766100 7.843761 7.922199
[209] 8.001421 8.081435 8.162250 8.243872 8.326311 8.409574 8.493670 8.578606 8.664392 8.751036 8.838547 8.926932 9.016201
[222] 9.106363 9.197427 9.289401 9.382295 9.476118 9.570880 9.666588 9.763254 9.860887 9.959496 10.059091 10.159681 10.261278
[235] 10.363891 10.467530 10.572205 10.677927 10.784707 10.892554 11.001479 11.111494 11.222609 11.334835 11.448183 11.562665 11.678292
[248] 11.795075 11.913026 12.032156 12.152477 12.274002 12.396742 12.520710 12.645917 12.772376 12.900100 13.029101 13.159392 13.290985
[261] 13.423895 13.558134 13.693716 13.830653 13.968959 14.108649 14.249735 14.392233 14.536155 14.681517 14.828332 14.976615 15.126381
[274] 15.277645 15.430422 15.584726 15.740573 15.897979 16.056959 16.217528 16.379703 16.543500 16.708935 16.876025 17.044785 17.215233
[287] 17.387385 17.561259 17.736872 17.914240 18.093383 18.274317 18.457060 18.641630 18.828047 19.016327 19.206490 19.398555 19.592541
[300] 19.788466 19.986351 20.186214 20.388077 20.591957 20.797877 21.005856 21.215914 21.428073 21.642354 21.858778 22.077365 22.298139
[313] 22.521120 22.746332 22.973795 23.203533 23.435568 23.669924 23.906623 24.145689 24.387146 24.631018 24.877328 25.126101 25.377362
[326] 25.631136 25.887447 26.146322 26.407785 26.671863 26.938581 27.207967 27.480047 27.754847 28.032396 28.312720 28.595847 28.881805
[339] 29.170624 29.462330 29.756953 30.054523 30.355068 30.658618 30.965205 31.274857 31.587605 31.903481 32.222516 32.544741 32.870189
[352] 33.198891 33.530880 33.866188 34.204850 34.546899 34.892368 35.241291 35.593704 35.949641 36.309138 36.672229 37.038951 37.409341
[365] 37.783434
> backward_alitter
[1] 1.00000000 0.98010000 0.97029900 0.96059601 0.95099005 0.94148015 0.93206535 0.92274469 0.91351725 0.90438208 0.89533825 0.88638487
[13] 0.87752102 0.86874581 0.86005835 0.85145777 0.84294319 0.83451376 0.82616862 0.81790694 0.80972787 0.80163059 0.79361428 0.78567814
[25] 0.77782136 0.77004315 0.76234271 0.75471929 0.74717209 0.73970037 0.73230337 0.72498034 0.71773053 0.71055323 0.70344769 0.69641322
[37] 0.68944909 0.68255460 0.67572905 0.66897176 0.66228204 0.65565922 0.64910263 0.64261160 0.63618549 0.62982363 0.62352539 0.61729014
[49] 0.61111724 0.60500607 0.59895601 0.59296645 0.58703678 0.58116641 0.57535475 0.56960120 0.56390519 0.55826614 0.55268348 0.54715664
[61] 0.54168508 0.53626823 0.53090554 0.52559649 0.52034052 0.51513712 0.50998575 0.50488589 0.49983703 0.49483866 0.48989027 0.48499137
[73] 0.48014146 0.47534004 0.47058664 0.46588078 0.46122197 0.45660975 0.45204365 0.44752321 0.44304798 0.43861750 0.43423133 0.42988901
[85] 0.42559012 0.42133422 0.41712088 0.41294967 0.40882017 0.40473197 0.40068465 0.39667781 0.39271103 0.38878392 0.38489608 0.38104712
[97] 0.37723665 0.37346428 0.36972964 0.36603234 0.36237202 0.35874830 0.35516081 0.35160921 0.34809311 0.34461218 0.34116606 0.33775440
[109] 0.33437686 0.33103309 0.32772276 0.32444553 0.32120107 0.31798906 0.31480917 0.31166108 0.30854447 0.30545903 0.30240444 0.29938039
[121] 0.29638659 0.29342272 0.29048849 0.28758361 0.28470777 0.28186070 0.27904209 0.27625167 0.27348915 0.27075426 0.26804672 0.26536625
[133] 0.26271259 0.26008546 0.25748461 0.25490976 0.25236066 0.24983706 0.24733869 0.24486530 0.24241665 0.23999248 0.23759255 0.23521663
[145] 0.23286446 0.23053582 0.22823046 0.22594816 0.22368867 0.22145179 0.21923727 0.21704490 0.21487445 0.21272570 0.21059845 0.20849246
[157] 0.20640754 0.20434346 0.20230003 0.20027703 0.19827426 0.19629151 0.19432860 0.19238531 0.19046146 0.18855685 0.18667128 0.18480456
[169] 0.18295652 0.18112695 0.17931568 0.17752253 0.17574730 0.17398983 0.17224993 0.17052743 0.16882216 0.16713394 0.16546260 0.16380797
[181] 0.16216989 0.16054819 0.15894271 0.15735328 0.15577975 0.15422195 0.15267973 0.15115293 0.14964141 0.14814499 0.14666354 0.14519691
[193] 0.14374494 0.14230749 0.14088441 0.13947557 0.13808081 0.13670000 0.13533300 0.13397967 0.13263988 0.13131348 0.13000034 0.12870034
[205] 0.12741334 0.12613920 0.12487781 0.12362903 0.12239274 0.12116882 0.11995713 0.11875756 0.11756998 0.11639428 0.11523034 0.11407804
[217] 0.11293725 0.11180788 0.11068980 0.10958291 0.10848708 0.10740221 0.10632818 0.10526490 0.10421225 0.10317013 0.10213843 0.10111704
[229] 0.10010587 0.09910482 0.09811377 0.09713263 0.09616130 0.09519969 0.09424769 0.09330522 0.09237216 0.09144844 0.09053396 0.08962862
[241] 0.08873233 0.08784501 0.08696656 0.08609689 0.08523592 0.08438357 0.08353973 0.08270433 0.08187729 0.08105852 0.08024793 0.07944545
[253] 0.07865100 0.07786449 0.07708584 0.07631498 0.07555183 0.07479632 0.07404835 0.07330787 0.07257479 0.07184904 0.07113055 0.07041925
[265] 0.06971505 0.06901790 0.06832772 0.06764445 0.06696800 0.06629832 0.06563534 0.06497899 0.06432920 0.06368590 0.06304905 0.06241855
[277] 0.06179437 0.06117643 0.06056466 0.05995901 0.05935942 0.05876583 0.05817817 0.05759639 0.05702043 0.05645022 0.05588572 0.05532686
[289] 0.05477359 0.05422586 0.05368360 0.05314676 0.05261530 0.05208914 0.05156825 0.05105257 0.05054204 0.05003662 0.04953626 0.04904089
[301] 0.04855049 0.04806498 0.04758433 0.04710849 0.04663740 0.04617103 0.04570932 0.04525222 0.04479970 0.04435171 0.04390819 0.04346911
[313] 0.04303442 0.04260407 0.04217803 0.04175625 0.04133869 0.04092530 0.04051605 0.04011089 0.03970978 0.03931268 0.03891955 0.03853036
[325] 0.03814505 0.03776360 0.03738597 0.03701211 0.03664199 0.03627557 0.03591281 0.03555368 0.03519815 0.03484617 0.03449770 0.03415273
[337] 0.03381120 0.03347309 0.03313836 0.03280697 0.03247890 0.03215411 0.03183257 0.03151425 0.03119911 0.03088711 0.03057824 0.03027246
[349] 0.02996974 0.02967004 0.02937334 0.02907960 0.02878881 0.02850092 0.02821591 0.02793375 0.02765441 0.02737787 0.02710409 0.02683305
[361] 0.02656472 0.02629907 0.02603608 0.02577572 0.02551796
3 開(kāi)始差異并不大氮唯,但后面差異相當(dāng)大鉴吹,所以我做了些變換
分別又看了每天進(jìn)步和退步的差值和比值。然后掐頭去尾看了下惩琉。
day_data <- data.frame(day = 1:365, forward = forward_alittle, backward = backward_alitter) %>%
mutate(difference_minus = forward-backward, difference_fold = forward/backward)
head(day_data)
tail(day_data)
> head(day_data)
day forward backward difference_minus difference_fold
1 1 1.000000 1.0000000 0.000000 1.000000
2 2 1.020100 0.9801000 0.040000 1.040812
3 3 1.030301 0.9702990 0.060002 1.061839
4 4 1.040604 0.9605960 0.080008 1.083290
5 5 1.051010 0.9509900 0.100020 1.105175
6 6 1.061520 0.9414801 0.120040 1.127501
> tail(day_data)
day forward backward difference_minus difference_fold
360 360 35.94964 0.02683305 35.92281 1339.752
361 361 36.30914 0.02656472 36.28257 1366.818
362 362 36.67223 0.02629907 36.64593 1394.430
363 363 37.03895 0.02603608 37.01292 1422.601
364 364 37.40934 0.02577572 37.38357 1451.340
365 365 37.78343 0.02551796 37.75792 1480.660
做個(gè)圖看下
library(ggplot2)
library(cowplot)
x_plot <- ggplot(data = day_data, aes(x = day))
for_plot <- x_plot + geom_point(aes(y = forward), color = "red")+
labs(title = "每天進(jìn)步一點(diǎn)點(diǎn)")
bac_plot <- x_plot + geom_point(aes(y = backward), color = "green")+
labs(title = "每天退步一點(diǎn)點(diǎn)")
minus_plot <- x_plot+ geom_point(aes(y = difference_minus), color = "black")+
labs(title = "每天相差一點(diǎn)點(diǎn)")
fold_plot <- x_plot + geom_point(aes(y = difference_fold), color = "blue")+
labs(title = "每天倍增一點(diǎn)點(diǎn)")
plot_grid(for_plot, bac_plot, minus_plot, fold_plot, labels = c(LETTERS[1:4]))
上面這四個(gè)圖都是非線性變化豆励。
A圖,開(kāi)始的進(jìn)步相對(duì)較小瞒渠,不容易看出來(lái)良蒸,這可能是讓人開(kāi)始很難堅(jiān)持做某件事的原因。但只要堅(jiān)持住就可以厚積薄發(fā)伍玖,大概200天的時(shí)候開(kāi)始飛躍嫩痰。而等到后期快符合荷花定律了。
B圖私沮,開(kāi)始的退步就非常明顯始赎,滑梯一般下降,50天左右已經(jīng)面目全非了仔燕。
逆水行舟,不進(jìn)則退
C圖魔招,進(jìn)步和退步之間的差距晰搀,開(kāi)始也不明顯,從0開(kāi)始办斑,但到了后期變得陡峭外恕。進(jìn)入大學(xué)或工作之后,不停奔跑的人乡翅。
D圖鳞疲,前200天,差異不顯著蠕蚜,但260左右尚洽,直升機(jī)般上升。如果要做的出類拔萃靶累,真的需要耐得住時(shí)間和開(kāi)始不顯著的差異腺毫。
4放一個(gè)圖
ggplot(data = day_data, aes(y = day)) +
geom_point(aes(x = forward), color = "red") +
geom_point(aes(x = backward), color = "green") +
geom_point(aes(x = difference_fold), color = "blue")
上述規(guī)律在我們生活中很多無(wú)形應(yīng)用癣疟,比如
1.每天跑步一個(gè)小時(shí)。
每天跑步一小時(shí)潮酒,堅(jiān)持下來(lái)并不容易睛挚。但是每天的鍛煉對(duì)我們的影響并非線性疊加。每天的肌肉都比前一天更好急黎,而不是比第一天更好扎狱。在跑步中獲得的信心,自由也都比前一天更強(qiáng)勃教。每天的基數(shù)不斷增加委乌,而進(jìn)步在持續(xù),這實(shí)際就是復(fù)利荣回。
2.知識(shí)的獲取
新知識(shí)如果要更好被記憶遭贸,被理解,被應(yīng)用心软,需要掛靠到我們已經(jīng)熟知或熟悉的已有知識(shí)體系中壕吹,不斷擴(kuò)大的知識(shí)網(wǎng)絡(luò)提供了更大更堅(jiān)實(shí)的搭載系統(tǒng),這是知識(shí)復(fù)利删铃。
3.如果說(shuō)鍛煉是硬件復(fù)利的增長(zhǎng)耳贬,那軟件的增長(zhǎng)也有復(fù)利系統(tǒng)。
一點(diǎn)一滴的改變自己猎唁,用好的理念好的支持體系給予自己強(qiáng)大的信念咒劲,不為外界風(fēng)雨左右這種改變。也會(huì)越來(lái)越好诫隅。雖然開(kāi)始的改變可能很難很慢腐魂,甚至根本無(wú)從覺(jué)察租漂。但是一旦播下好的理念的種子纵揍,假以時(shí)日,就會(huì)由恍然大悟提醒自己式的改變變成自己思維內(nèi)在的一部分自發(fā)行為滥搭。復(fù)利已經(jīng)開(kāi)始生長(zhǎng)豁生。
還有很多很多的復(fù)利系統(tǒng)存在我們的生活中……
幾句話共勉
1(連岳)
跟自己比兔毒,每天都比昨天更好,在這過(guò)程中更理解人性甸箱,你知道其中從掙扎到掙脫的過(guò)程育叁,就像花朵突然綻放,它想必也很累芍殖,需要舉重一般突然發(fā)力豪嗽,在這個(gè)過(guò)程中也知道學(xué)習(xí)與成長(zhǎng)的規(guī)律,你的孩子或?qū)W生需要重復(fù)這個(gè)過(guò)程,你將是一個(gè)很好的引領(lǐng)者昵骤,可讓他保持速度树碱,又讓他充滿希望。你的成長(zhǎng)变秦,就是你所處系統(tǒng)的成長(zhǎng)成榜。
跟自己比,明天的足跡必須必今天的自己更好蹦玫,智慧增多一點(diǎn)赎婚,能力加強(qiáng)一點(diǎn),財(cái)富增加一點(diǎn)樱溉,這應(yīng)當(dāng)成命令挣输。人的一生,只要是和自己比福贞,一生的進(jìn)步和快樂(lè)撩嚼,只會(huì)終止于死亡。
2 (連岳)
聰明又勤奮的人挖帘,認(rèn)定一件事完丽,做半輩子,沒(méi)有不登峰造極的拇舀。這樣的人會(huì)堅(jiān)持一輩子逻族。
勤奮是一種主動(dòng)的選擇,一個(gè)人想勤奮就可以勤奮骄崩,大方向不錯(cuò)聘鳞,勤奮地聚焦于一件事,不需要半輩子要拂,10年之后抠璃,你在專注的事業(yè)上,就很聰明了宇弛。
繼續(xù)在自己專注的領(lǐng)域勤奮吧鸡典。細(xì)水長(zhǎng)流,直至天長(zhǎng)地久枪芒。
3 YKK
往前一步,再往前一步谁尸,不慌亂舅踪。只要一直在走。不要在開(kāi)始看不到進(jìn)步的時(shí)候想著放棄良蛮,只要思考過(guò)后覺(jué)得可行的抽碌,堅(jiān)定一步一個(gè)腳印走下去,定會(huì)走出寬闊大道。