create account

current_median_history计算时用到的小学数学 by oflyhigh

View this thread on: hive.blogpeakd.comecency.com
· @oflyhigh ·
$47.45
current_median_history计算时用到的小学数学
前阶段大家都知道SBD脱锚了(所谓的脱锚,就是原本号称锚定1美元的SBD,贬值至低于一美元)。造成这种情况的原因可以参考我之前的一个帖子:[Why is median_history_price no longer the median of feed price? My investigation.](https://steemit.com/witness-category/@oflyhigh/why-is-medianhistoryprice-no-longer-the-median-of-feed-price-my-investigation)。

![](https://cdn.steemitimages.com/DQmP5qxbhBvzW4JBCcqbYoGGV793xrKQL69M6kCoHTmoNKf/image.png)
(图源 :[pixabay](https://pixabay.com/en/mathematics-formula-physics-school-757566/) by [geralt](https://pixabay.com/en/users/geralt-9301/))

# ***`current_median_history`***的公式

简单的归结一下原因就是:
>***保证任何时刻SBD的供应量不大于总供应量的10%***

所以如果用见证人历史喂价算出的***`current_median_history`***不能保证SBD的供应量小于等于总供应量的10%,则***`current_median_history`***按SBD占比为10%由供应量算出。

好,我们都知道按现在的STEEM价格,SBD的占比已经远远超过了10%,所以上述机制起作用了,那么SBD供应量、STEEM供应量、以及***`current_median_history`***的就有了如下关系:

>![](https://cdn.steemitimages.com/DQmUXXrimxQ1fwmbEPBkVPLH23cTD6vXTmE8KQo9zKXjUGB/image.png)

看起来有点混乱,因为***`current_median_history`***是我们要计算的值,所用我们用x来表示,这样看起来就简单多了。
>![](https://cdn.steemitimages.com/DQmXU8rAzoV2DfbB8G4Mv2Y8Spmdh7pgyhnsUpKYn7kDMFk/image.png)

# ***`current_median_history`***的计算过程

那么如何计算上述公式中的x的值呢?或许可以考虑用程序解方程,姑且不考虑如何实现,显而易见的是那样做会消耗很多资源浪费很多时间。所以这时候我们小学学过的数学知识就可以拿来大显身手了。

第一步,把上述公式变换为:
>![](https://cdn.steemitimages.com/DQmbBF7dvNVapPLoPQv7A8zWs2UCRzbMGV87erxMwWBNJyj/image.png)

再展开
>![](https://cdn.steemitimages.com/DQmbxFdyzd1ij3WvxMjUKBsvc1BcivD5dattFXoTwYnA22K/image.png)

变换一下:
>![](https://cdn.steemitimages.com/DQmPvENUqrLCJLsD9eGzuikBPMurgPkZFhzCucnXmjRcvXk/image.png)

继续处理:
>![](https://cdn.steemitimages.com/DQmfXfNr2vJ1QptMZWMYxYnFJ4VLosKaYcXFBPHSSo4RgLN/image.png)

这时候我们就可以看出来x亦即***`current_median_history`***的值了
>![](https://cdn.steemitimages.com/DQmUum2bPZLhcXtsbARWXkgED4chjBXvZp7rmmMtW2ainX4/image.png)

所以,对于***`current_median_history`***,我们的程序无需进行复杂的计算,直接将SBD供应量、STEEM供应量代入上述公式即可。

# 总结

尽管有了计算机以后,好多计算都可以交给计算机来处理,但是在有些场景,***应用简单的数学知识就可以大幅简化计算流程提升、减少资源占用、提升效率!***。

而实际上,数学就是计算机科学的基石,计算机科学的方方面面都离不开数学,就比如说我现在在STEEM上发帖,涉及到公钥私钥、签名和验证等,就涉及到椭圆曲线的应用。

当然了,凭我小学六年级毕业的文化水平,太复杂的原理或者内容我也讲不出来,能通过这个例子给大家一丁点启发就满足啦。

# 相关链接

* [Why is median_history_price no longer the median of feed price? My investigation.](https://steemit.com/witness-category/@oflyhigh/why-is-medianhistoryprice-no-longer-the-median-of-feed-price-my-investigation)
* https://github.com/steemit/steem/blob/master/libraries/chain/database.cpp#L3258
* [每天进步一点点: 学习比特币的公钥](https://steemit.com/cn/@oflyhigh/61quvw)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 506 others
properties (23)
authoroflyhigh
permlinkcurrentmedianhistory
categorycn-stem
json_metadata{"tags":["cn-stem","steemstemfeed","steem","cn"],"image":["https://cdn.steemitimages.com/DQmP5qxbhBvzW4JBCcqbYoGGV793xrKQL69M6kCoHTmoNKf/image.png","https://cdn.steemitimages.com/DQmUXXrimxQ1fwmbEPBkVPLH23cTD6vXTmE8KQo9zKXjUGB/image.png","https://cdn.steemitimages.com/DQmXU8rAzoV2DfbB8G4Mv2Y8Spmdh7pgyhnsUpKYn7kDMFk/image.png","https://cdn.steemitimages.com/DQmbBF7dvNVapPLoPQv7A8zWs2UCRzbMGV87erxMwWBNJyj/image.png","https://cdn.steemitimages.com/DQmbxFdyzd1ij3WvxMjUKBsvc1BcivD5dattFXoTwYnA22K/image.png","https://cdn.steemitimages.com/DQmPvENUqrLCJLsD9eGzuikBPMurgPkZFhzCucnXmjRcvXk/image.png","https://cdn.steemitimages.com/DQmfXfNr2vJ1QptMZWMYxYnFJ4VLosKaYcXFBPHSSo4RgLN/image.png","https://cdn.steemitimages.com/DQmUum2bPZLhcXtsbARWXkgED4chjBXvZp7rmmMtW2ainX4/image.png"],"links":["https://steemit.com/witness-category/@oflyhigh/why-is-medianhistoryprice-no-longer-the-median-of-feed-price-my-investigation","https://pixabay.com/en/mathematics-formula-physics-school-757566/","https://pixabay.com/en/users/geralt-9301/","https://github.com/steemit/steem/blob/master/libraries/chain/database.cpp#L3258","https://steemit.com/cn/@oflyhigh/61quvw"],"app":"steemit/0.1","format":"markdown"}
created2018-12-23 12:25:42
last_update2018-12-23 12:25:42
depth0
children6
last_payout2018-12-30 12:25:42
cashout_time1969-12-31 23:59:59
total_payout_value35.979 HBD
curator_payout_value11.470 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,435
author_reputation6,395,131,018,162,468
root_titlecurrent_median_history计算时用到的小学数学
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,268,319
net_rshares84,391,782,208,502
author_curate_reward""
vote details (570)
@anlida ·
那意思是现在steemit的价值贬低了
properties (22)
authoranlida
permlinkre-oflyhigh-currentmedianhistory-20181224t063239720z
categorycn-stem
json_metadata{"tags":["cn-stem"],"app":"steemit/0.1"}
created2018-12-24 06:32:42
last_update2018-12-24 06:32:42
depth1
children0
last_payout2018-12-31 06:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length19
author_reputation35,843,703,717
root_titlecurrent_median_history计算时用到的小学数学
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id77,303,707
net_rshares0
@maiyude ·
$0.04
看出来了,解决方案就是拉个盘即可。
👍  ,
properties (23)
authormaiyude
permlinkre-oflyhigh-currentmedianhistory-20181223t131813532z
categorycn-stem
json_metadata{"tags":["cn-stem"],"app":"steemit/0.1"}
created2018-12-23 13:18:21
last_update2018-12-23 13:18:21
depth1
children1
last_payout2018-12-30 13:18:21
cashout_time1969-12-31 23:59:59
total_payout_value0.028 HBD
curator_payout_value0.009 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length17
author_reputation8,970,701,360,387
root_titlecurrent_median_history计算时用到的小学数学
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,270,117
net_rshares68,382,117,590
author_curate_reward""
vote details (2)
@oflyhigh ·
起床拉盘啦
properties (22)
authoroflyhigh
permlinkre-maiyude-re-oflyhigh-currentmedianhistory-20181224t011230447z
categorycn-stem
json_metadata{"tags":["cn-stem"],"app":"steemit/0.1"}
created2018-12-24 01:12:30
last_update2018-12-24 01:12:30
depth2
children0
last_payout2018-12-31 01:12:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5
author_reputation6,395,131,018,162,468
root_titlecurrent_median_history计算时用到的小学数学
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,294,408
net_rshares0
@partiko ·
Thank you so much for participating the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.00% upvote! Together, let’s change the world!
properties (22)
authorpartiko
permlinkre-currentmedianhistory-20181223t133017
categorycn-stem
json_metadata""
created2018-12-23 13:30:18
last_update2018-12-23 13:30:18
depth1
children0
last_payout2018-12-30 13:30:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length210
author_reputation39,207,160,334,751
root_titlecurrent_median_history计算时用到的小学数学
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,270,590
net_rshares0
@steemstem ·
$2.25
re-oflyhigh-currentmedianhistory-20181225t105533093z
<div class='text-justify'> <div class='pull-left'> <br /> <center> <img width='125' src='https://i.postimg.cc/Gtd18f7W/steemstem_curie_utopian.png'> </center> <br /> </div> <br /> <br /> 

 This post has been voted on by the **SteemSTEM** curation team and voting trail in collaboration with **@utopian-io** and **@curie**. <br /> 
 If you appreciate the work we are doing then consider [voting](https://steemit.com/~witnesses) all three projects for witness by selecting [**stem.witness**](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=stem.witness), [**utopian-io**](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=utopian-io) and [**curie**](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=curie)! <br /> 
 For additional information please join us on the [**SteemSTEM discord**]( https://discord.gg/BPARaqn) and to get to know the rest of the community! </div>
👍  ,
properties (23)
authorsteemstem
permlinkre-oflyhigh-currentmedianhistory-20181225t105533093z
categorycn-stem
json_metadata{"app":"bloguable-bot"}
created2018-12-25 10:55:36
last_update2018-12-25 10:55:36
depth1
children0
last_payout2019-01-01 10:55:36
cashout_time1969-12-31 23:59:59
total_payout_value1.687 HBD
curator_payout_value0.561 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length929
author_reputation262,017,435,115,313
root_titlecurrent_median_history计算时用到的小学数学
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,357,559
net_rshares3,970,142,923,214
author_curate_reward""
vote details (2)
@utopian-io ·
#### Hi @oflyhigh!

Your post was upvoted by Utopian.io in cooperation with @steemstem - supporting knowledge, innovation and technological advancement on the Steem Blockchain.

#### Contribute to Open Source with utopian.io
Learn how to contribute on <a href='https://join.utopian.io'>our website</a> and join the new open source economy.

**Want to chat? Join the Utopian Community on Discord https://discord.gg/h52nFrV**
properties (22)
authorutopian-io
permlinkre-currentmedianhistory-20181225t224902z
categorycn-stem
json_metadata"{"app": "beem/0.20.9"}"
created2018-12-25 22:49:03
last_update2018-12-25 22:49:03
depth1
children0
last_payout2019-01-01 22:49:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length423
author_reputation152,955,367,999,756
root_titlecurrent_median_history计算时用到的小学数学
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,380,346
net_rshares0