create account

Computation Contest #2 [2 SBI for every participant!] by quantumdeveloper

View this thread on: hive.blogpeakd.comecency.com
· @quantumdeveloper · (edited)
$0.21
Computation Contest #2 [2 SBI for every participant!]
Here you can solve interesting problems using whatever programming language you like. Also you will earn [SBI](https://steemit.com/@steembasicincome) and sometimes [STEM](https://stemgeeks.net) by doing so.
Also you might learn new things by doing so.
The tasks will be rather hard to solve without a programmable computer and some programming skills, but if you want to add a few million numbers by hand or similar, I would still give you the reward.
*↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓*
# Rules
#### No upvote, No resteem, No follow required!
#### I will give 2 SBI for every correct entry.
#### If two pieces of code are to closely related I might consider the later of them as copied which results in no prize for that person.
#### You have 4 days to solve it.
#### Even though this is about computation I will also accept algebraic solutions if you find one.
*↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓*

# Problem
Today I want you to do some numerical stuff.
Consider the following sum:
![Screenshot from 2019-10-27 20-41-05.png](https://cdn.steemitimages.com/DQmPS85hXVwam5ArpdSPqCYGaaDd94UweiJEr5qYYijqPko/Screenshot%20from%202019-10-27%2020-41-05.png)
s is a complex number with
s = 0.5 + yi
The sum does converge for any real y.

#### Now your task is to use numerical methods to find the smallest value for y > 0 where the sum does converge to 0.

You don't need to be more precise than 3 decimal places.

*Tip: The distance between any two consecutive zeros of the sum is generally bigger than 1.*

*Tip 2(added on @crokkon 's request): There are several 100 zeros between 1 and 1000.*

If you don't know complex numbers it would be time to learn about them. They are pretty useful in many cases!

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

To everyone who already participated in a past contest, come back today and try a new problem(tell me if you don't want to be tagged):
@crokkon @kaeserotor

In case no one gets a result(which I doubt), I will give away the prize equivalent of one participant to the person who makes the most constructive description why the problem is too hard in your opinion.

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

@contrabourdon sponsors my contests with 2 STEEM weekly.
You can support him by [using a witness vote on untersatz](https://v2.steemconnect.com/sign/account-witness-vote?witness=untersatz&approve=1), so he can further support this and other contests.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorquantumdeveloper
permlinkcomputation-contest-2-2-sbi-for-every-participant
categorypuzzle
json_metadata{"tags":["puzzle","contest","sbi","steembasicincome","programming","math","stem","steemstem","steemiteducation","palnet"],"users":["crokkon","kaeserotor","contrabourdon"],"image":["https://cdn.steemitimages.com/DQmPS85hXVwam5ArpdSPqCYGaaDd94UweiJEr5qYYijqPko/Screenshot%20from%202019-10-27%2020-41-05.png"],"links":["https://steemit.com/@steembasicincome","https://stemgeeks.net","https://v2.steemconnect.com/sign/account-witness-vote?witness=untersatz&approve=1"],"app":"palnet/0.1","format":"markdown","canonical_url":"undefined/@quantumdeveloper/computation-contest-2-2-sbi-for-every-participant"}
created2019-10-27 19:54:24
last_update2019-10-29 17:59:09
depth0
children7
last_payout2019-11-03 19:54:24
cashout_time1969-12-31 23:59:59
total_payout_value0.107 HBD
curator_payout_value0.103 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,451
author_reputation4,456,611,502,865
root_title"Computation Contest #2 [2 SBI for every participant!]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id91,960,043
net_rshares1,136,671,324,421
author_curate_reward""
vote details (32)
@crokkon · (edited)
properties (23)
authorcrokkon
permlinkq04ldl
categorypuzzle
json_metadata"{"app": ""}"
created2019-10-29 07:41:45
last_update2022-09-18 07:32:00
depth1
children3
last_payout2019-11-05 07:41:45
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_length1
author_reputation81,214,366,861,104
root_title"Computation Contest #2 [2 SBI for every participant!]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,003,895
net_rshares12,417,496,115
author_curate_reward""
vote details (3)
@quantumdeveloper · (edited)
Your approach looks pretty good so far.
Yes I want you to find `abs(sum) = 0`.

Your only problem is that you are are looking at the wrong magnitude and accuracy.
Tip: Between 1 and 1000 are already several 100 zeros.

In general if you approach something like this you need to check roughly first and then go more and more detailed in the regions that contain a change of sign or are close to zero. Especially on complex functions it is useful to look for zeros in real and imaginary part separately.
👍  
properties (23)
authorquantumdeveloper
permlinkq05dus
categorypuzzle
json_metadata{"app":"steemit/0.1"}
created2019-10-29 17:56:54
last_update2019-10-29 17:59:30
depth2
children2
last_payout2019-11-05 17:56:54
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_length501
author_reputation4,456,611,502,865
root_title"Computation Contest #2 [2 SBI for every participant!]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,018,320
net_rshares2,339,476,561
author_curate_reward""
vote details (1)
@crokkon · (edited)
$0.03
properties (23)
authorcrokkon
permlinkq05ieq
categorypuzzle
json_metadata"{"app": ""}"
created2019-10-29 19:35:15
last_update2022-09-18 07:31:39
depth3
children1
last_payout2019-11-05 19:35:15
cashout_time1969-12-31 23:59:59
total_payout_value0.016 HBD
curator_payout_value0.015 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1
author_reputation81,214,366,861,104
root_title"Computation Contest #2 [2 SBI for every participant!]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,020,481
net_rshares195,419,720,034
author_curate_reward""
vote details (4)
@tonimontana ·
I am not sure lol. I just looked a the plot and guessed where the first zero is. The convergence is not very good but I got something like 14.13.

```python 
import matplotlib.pyplot as plt
def f(y):
    s=complex(0.5,y)
    sum=0
    for i in range(1,10000):
        sum=sum+(i/((i+1)**s))-((i-s)/(i**s))
    return abs(sum)**2


x=[y/10 for y in range(0, 300)]
y=[f(y/10) for y in range(0, 300)]

plt.plot(x, y)
x=14
h=10**-6
for i in range(0,1000):
    temp=f(x)
    df=(f(x+h)-temp)/h
    if(df==0):
        break
    x=x-temp/df
    
print(x)
👍  
properties (23)
authortonimontana
permlinkq05o9s
categorypuzzle
json_metadata{"tags":["puzzle","stem"],"app":"stemgeeks/0.1","canonical_url":"https://stemgeeks.net/@tonimontana/q05o9s"}
created2019-10-29 21:41:51
last_update2019-10-29 21:41:51
depth1
children2
last_payout2019-11-05 21:41: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_length547
author_reputation4,423,485,388,975
root_title"Computation Contest #2 [2 SBI for every participant!]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,023,209
net_rshares4,361,674,027
author_curate_reward""
vote details (1)
@tonimontana ·
Altough I am not sure if 14.13 even is a zero :)
👍  
properties (23)
authortonimontana
permlinkq05ppx
categorypuzzle
json_metadata{"tags":["puzzle","stem"],"app":"stemgeeks/0.1","canonical_url":"https://stemgeeks.net/@tonimontana/q05ppx"}
created2019-10-29 22:13:09
last_update2019-10-29 22:13:09
depth2
children0
last_payout2019-11-05 22:13: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_length48
author_reputation4,423,485,388,975
root_title"Computation Contest #2 [2 SBI for every participant!]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,023,808
net_rshares4,273,568,142
author_curate_reward""
vote details (1)
@tonimontana · (edited)
I made another one that works a bit better. The real part seems to always cross the x-axis at a zero(See picture). So the zeros of the real part can easily befound by bisection. Then just check if the imaginary part is 0 aswell :) I got 14.141171601414683 and
21.025945073366167 as the first 2 zeros.
![nn.png](https://cdn.steemitimages.com/DQmW6qvGynijNoxmdSHAH4TJk2Q3HWu3XFNHsFhG9xz3XKB/nn.png)
```python
import matplotlib.pyplot as plt
def realf(y):
    s=complex(0.5,y)
    sum=0
    for i in range(1,10000):
        sum=sum+(i/((i+1)**s))-((i-s)/(i**s))
    return sum.real
def imagf(y):
    s=complex(0.5,y)
    sum=0
    for i in range(1,10000):
        sum=sum+(i/((i+1)**s))-((i-s)/(i**s))
    return sum.imag


x=[y/10 for y in range(0, 300)]
y=[realf(y/10) for y in range(0, 300)]

plt.plot(x, y)

candi=[] #Find points with alternating sign
for x in range(0,len(y)-1):
    if(y[x]*y[x+1]<0):
        candi.append([x/10,(x+1)/10])
    
    

for x in candi:
    if(realf(x[0])<0):
        sign=-1
    else:
        sign=1
    x1=x[0]
    x2=x[1]
    tol=1
    while tol>1e-8:
        temp=realf((x1+x2)/2)
        tol=abs(temp)
        if(sign*temp>0):
            x1=(x1+x2)/2
        else:
            x2=(x1+x2)/2
            
            
    if(imagf(x1)<1e-3):        
        print(x1)
👍  
properties (23)
authortonimontana
permlinkq07c45
categorypuzzle
json_metadata{"tags":["puzzle","stem"],"image":["https://cdn.steemitimages.com/DQmW6qvGynijNoxmdSHAH4TJk2Q3HWu3XFNHsFhG9xz3XKB/nn.png"],"app":"stemgeeks/0.1","canonical_url":"https://stemgeeks.net/@tonimontana/q07c45"}
created2019-10-30 19:14:30
last_update2019-10-30 19:14:57
depth2
children0
last_payout2019-11-06 19:14: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_length1,303
author_reputation4,423,485,388,975
root_title"Computation Contest #2 [2 SBI for every participant!]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,050,507
net_rshares4,543,447,594
author_curate_reward""
vote details (1)