Cody

Solution 2057173

Submitted on 13 Dec 2019 by Asif Newaz
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
n = 1; y_correct = 0.00; assert(abs(birthday_prob(n)-y_correct) <= 0.015)

a = 365 b = 365 y = 0

2   Pass
n = 366; y_correct = 1.00; assert(abs(birthday_prob(n)-y_correct) <= 0.015)

a = 0 b = Inf y = 1

3   Pass
n = 0; y_correct = 0.00; assert(abs(birthday_prob(n)-y_correct) <= 0.015)

a = 1 b = 1 y = 0

4   Pass
n = 23; y_correct = 0.5073; assert(abs(birthday_prob(n)-y_correct) <= 0.015)

a = 4.2201e+58 b = 8.5652e+58 y = 0.5073

5   Pass
n = 50; y_correct = 0.9704; assert(abs(birthday_prob(n)-y_correct) <= 0.015)

a = 3.8576e+126 b = 1.3021e+128 y = 0.9704

6   Pass
n = 100; y_correct = 1.0000; assert(abs(birthday_prob(n)-y_correct) <= 0.015)

a = 5.2093e+249 b = 1.6955e+256 y = 1.0000

7   Pass
n = 10 y_correct = 0.1169; assert(abs(birthday_prob(n)-y_correct) <= 0.015)

n = 10 a = 3.7061e+25 b = 4.1969e+25 y = 0.1169

8   Pass
n = 13 y_correct = 0.1944; assert(abs(birthday_prob(n)-y_correct) <= 0.015)

n = 13 a = 1.6441e+33 b = 2.0408e+33 y = 0.1944

9   Pass
n = 2; y_correct = 1/365; assert(abs(birthday_prob(n)-y_correct) <= 0.015)

a = 132860 b = 133225 y = 0.0027