Test  Status  Code Input and Output 

1  Pass 
%%
x = 1800;
y = 1800;
assert(isequal(expected_score(x,y),0.5))
y =
0.5000

2  Pass 
%%
x = 1900;
y = 1800;
assert(isequal(expected_score(x,y),0.64))
y =
0.6400

3  Pass 
%%
x = 1900;
y = 2000;
assert(isequal(expected_score(x,y),0.36))
y =
0.3600

4  Pass 
%%
x = 1900;
y = 2100;
assert(isequal(expected_score(x,y),0.24))
y =
0.2400

5  Pass 
%% My probability against Maxime VachierLagrave (best french player)
x = 1800;
y = 2775;
assert(isequal(expected_score(x,y),0.004))
y =
0.0040

6  Pass 
%% My probability against Magnus Carlsen (World Chess Champion)
x = 1800;
y = 2865;
assert(isequal(expected_score(x,y),0.002))
y =
0.0020

7  Pass 
%% Magnus against Maxime
x = 2865;
y = 2775;
assert(isequal(expected_score(x,y),0.627))
y =
0.6270

8  Pass 
%% Magnus Carlsen against Garry Kasparov (1999)
x = 2865;
y = 2851;
assert(isequal(expected_score(x,y),0.52))
y =
0.5200

9  Pass 
%% Magnus Carlsen against Fabiano Caruana
x = 2865;
y = 2844;
assert(isequal(expected_score(x,y),0.53))
y =
0.5300

10  Pass 
%% Bobby Fisher (1972) against Magnus Carlsen
x = 2785;
y = 2865;
assert(isequal(expected_score(x,y),0.387))
y =
0.3870

11  Pass 
%% Bobby Fisher (1972) against me
x = 2785;
y = 1800;
assert(isequal(expected_score(x,y),0.997))
y =
0.9970

Project Euler: Problem 6, Natural numbers, squares and sums.
965 Solvers
Sum of first n terms of a harmonic progression
244 Solvers
Calculate the area of a triangle between three points
659 Solvers
Create an indexpowered vector
329 Solvers
492 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!