create account

Computation Contest #4 Results and Solution by quantumdeveloper

View this thread on: hive.blogpeakd.comecency.com
· @quantumdeveloper ·
$0.21
Computation Contest #4 Results and Solution
## Solution
The problem of this contest was to solve the exponential integral numerically:
![](https://cdn.steemitimages.com/DQmSX58jkRydg9JzNoMsnN8MiZBubLrYeEwByEBq3JiNrsZ/image.png)

I implemented an example solution in java which takes your a number x as input and integrates between 1/x and x by dividing it into 10⁹ sections:
```
public class abcd {
	public static double f(double x) { // Whatever function you want to integrate.
		return Math.exp(x)/x;
	}
	public static void main(String[] args) {
		double xMax = Double.parseDouble(args[0]);
		double xMin = 1/xMax;
		double Δx = (xMax-xMin)/1.0e9;
		double total = 0;
		for(double x = xMin; x < xMax; x += Δx) {
			total += f(x)*Δx;
		}
		System.out.println(total);
	}
}
```

This prints out when used for my own reputation(57):
```
1.0156434538674713E23
```
This is pretty close to the value supplied by wolframalpha(thanks to @kaeserotor for mentioning it.), but still only a small amount of digits.

In the next contest you will apply a slightly different method for integrating this same function. It will be a lot more accurate(f you plug in numbers of the right magnitude…).
So you might want to keep your code for comparison.

*↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓*
### List of participants with their entries:
Name | Solution found | Comment
 - | - 
@kaeserotor | 1.0156373595307505e+23 for 57 | By the way you said you are unsure what your computer can handle. Most of the time if whatever operation you do inside the loop is not too long(a few lines) you can be pretty sure that on any modern computer(having a GHz processor) it should run within a minute.
@crokkon | 9.178120876620503e+27 for 68.6 | correct.

*↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓*

## Winners:
Congratulations @kaeserotor and @crokkon, you won 1 SBI each!

*↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓*
### The next contest starts in 2 days. Don't miss it!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorquantumdeveloper
permlinkcomputation-contest-4-results-and-solution
categoryprogramming
json_metadata{"tags":["programming","puzzle","contest","steembasicincome","stem","math","steemstem","steemiteducation","palnet","sbi"],"users":["kaeserotor","crokkon"],"image":["https://cdn.steemitimages.com/DQmSX58jkRydg9JzNoMsnN8MiZBubLrYeEwByEBq3JiNrsZ/image.png"],"app":"palnet/0.1","format":"markdown","canonical_url":"undefined/@quantumdeveloper/computation-contest-4-results-and-solution"}
created2019-11-15 20:21:51
last_update2019-11-15 20:21:51
depth0
children6
last_payout2019-11-22 20:21:51
cashout_time1969-12-31 23:59:59
total_payout_value0.106 HBD
curator_payout_value0.101 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,925
author_reputation4,456,611,502,865
root_title"Computation Contest #4 Results and Solution"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,533,887
net_rshares1,146,507,743,679
author_curate_reward""
vote details (36)
@crokkon · (edited)
$0.06
properties (23)
authorcrokkon
permlinkq1162q
categoryprogramming
json_metadata"{"app": ""}"
created2019-11-15 21:52:00
last_update2022-09-18 07:28:42
depth1
children1
last_payout2019-11-22 21:52:00
cashout_time1969-12-31 23:59:59
total_payout_value0.029 HBD
curator_payout_value0.029 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1
author_reputation81,214,366,861,104
root_title"Computation Contest #4 Results and Solution"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,535,651
net_rshares343,679,436,256
author_curate_reward""
vote details (3)
@quantumdeveloper ·
Actually it's not too hard to type if you adjust your keyboard layout a bit.
I put Δ on "alt gr"+"shift"+"d" which isn't too hard to press when typing.
properties (22)
authorquantumdeveloper
permlinkq1238a
categoryprogramming
json_metadata{"app":"steemit/0.1"}
created2019-11-16 09:48:12
last_update2019-11-16 09:48:12
depth2
children0
last_payout2019-11-23 09:48:12
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_length151
author_reputation4,456,611,502,865
root_title"Computation Contest #4 Results and Solution"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,547,532
net_rshares0
@kaeserotor ·
Nice :D I just chose the step for the rectangle way too small once, like 10^-9 or something, and my laptop did not even let me abort the loop manually for a while, dont know what happened exactly though

Posted using [Partiko Android](https://partiko.app/referral/kaeserotor)
👍  
properties (23)
authorkaeserotor
permlinkkaeserotor-re-quantumdeveloper-computation-contest-4-results-and-solution-20191115t202611619z
categoryprogramming
json_metadata{"app":"partiko","client":"android"}
created2019-11-15 20:26:12
last_update2019-11-15 20:26:12
depth1
children0
last_payout2019-11-22 20:26:12
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_length275
author_reputation18,015,148,601,358
root_title"Computation Contest #4 Results and Solution"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,533,968
net_rshares4,512,096,404
author_curate_reward""
vote details (1)
@onecent ·
A bonus $trendotoken tip from ONECENT!
Also consider [MAPR fund](https://steem-engine.com/?p=market&t=MAPR) and [MAXUV](https://steem-engine.com/?p=market&t=MAXUV) vote bonds too.
MAP Steem FinTech: growing your STEEM without SP.
properties (22)
authoronecent
permlinkre-computation-contest-4-results-and-solution-20191115t202751z
categoryprogramming
json_metadata"{"app": "rewarding/0.1.5"}"
created2019-11-15 20:27:51
last_update2019-11-15 20:27:51
depth1
children0
last_payout2019-11-22 20:27:51
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_length231
author_reputation16,446,725,825,074
root_title"Computation Contest #4 Results and Solution"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,534,001
net_rshares0
@stem.curate ·
Hello,

Your post has been manually curated by a @stem.curate curator.

<center>![FA8866FD-F2C3-43B3-A5A5-E0324BA4BB47.jpeg](https://cdn.steemitimages.com/DQmaqMpaEpJBAwJMN9bCHhmTzUEuymBj8V4BMsiJteZMG7L/FA8866FD-F2C3-43B3-A5A5-E0324BA4BB47.jpeg)</Center><center> *Supporting Steemians on STEMGeeks*</center>

We are dedicated to supporting great content, like yours on the [STEMGeeks](stemgeeks.net) tribe.

Please join us on [discord](https://discord.gg/73WaANa).
properties (22)
authorstem.curate
permlinkq11u03
categoryprogramming
json_metadata{"tags":["programming","stem"],"users":["stem.curate"],"image":["https://cdn.steemitimages.com/DQmaqMpaEpJBAwJMN9bCHhmTzUEuymBj8V4BMsiJteZMG7L/FA8866FD-F2C3-43B3-A5A5-E0324BA4BB47.jpeg"],"links":["stemgeeks.net","https://discord.gg/73WaANa"],"app":"stemgeeks/0.1","canonical_url":"https://stemgeeks.net/@stem.curate/q11u03"}
created2019-11-16 06:28:51
last_update2019-11-16 06:28:51
depth1
children0
last_payout2019-11-23 06:28:51
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_length464
author_reputation599,563,679,404
root_title"Computation Contest #4 Results and Solution"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,543,861
net_rshares0
@trendotoken ·
Congratulations @quantumdeveloper, your post successfully recieved <b>6.88015013</b> [TRDO](https://steem-engine.com/?p=history&t=TRDO) from below listed TRENDO callers:<br>

>	<sup>@onecent earned : **4.58676675** [TRDO](https://steem-engine.com/?p=history&t=TRDO) curation</sup> 

---
<sup>To view or trade TRDO go to [steem-engine.com](https://steem-engine.com/?p=market&t=TRDO)
Join [TRDO Discord Channel](https://discord.gg/wySP8T9) or Join [TRDO Web Site](http://www.trendotoken.info/)</sup>
properties (22)
authortrendotoken
permlinkre-quantumdeveloper-computation-contest-4-results-and-solution-20191118t203109259z
categoryprogramming
json_metadata{"tags":["trdo","trendo-bot"],"app":"comments-scot/1.1","format":"markdown"}
created2019-11-18 20:31:09
last_update2019-11-18 20:31:09
depth1
children0
last_payout2019-11-25 20:31:09
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_length497
author_reputation5,546,209,053,433
root_title"Computation Contest #4 Results and Solution"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,623,111
net_rshares0