Cody

# Problem 1442. Volume of a Simplex

Solution 654769

Submitted on 17 Apr 2015 by Zikobrelli
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
user_solution = fileread('simplexvolume.m'); assert(isempty(strfind(user_solution,'regexp'))); assert(isempty(strfind(user_solution,'2str'))); assert(isempty(strfind(user_solution,'str2'))); assert(isempty(strfind(user_solution,'interp'))); assert(isempty(strfind(user_solution,'printf'))); assert(isempty(strfind(user_solution,'assert')));

2   Pass
%% n = 0; V_correct = 1.0; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 1

3   Pass
%% n = 1; V_correct = 1.0; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 1

4   Pass
%% n = 2; V_correct = 0.433012701892219; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 0.433012701892219

5   Pass
%% n = 3; V_correct = 0.117851130197758; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 0.117851130197758

6   Pass
%% n = 4; V_correct = 0.023292374765623; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 0.023292374765623

7   Pass
%% n = 5; V_correct = 0.003608439182435; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 0.003608439182435

8   Pass
%% n = 6; V_correct = 0.000459331824838; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 4.593318248376026e-04

9   Pass
%% n = 7; V_correct = 0.000049603174603; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 4.960317460317460e-05

10   Pass
%% n = 8; V_correct = 0.000004650297619; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 4.650297619047619e-06

11   Pass
%% n = 9; V_correct = 0.000000385125244; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 3.851252441405888e-07

12   Pass
%% n = 10; V_correct = 0.000000028561653; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 2.856165252937782e-08

13   Pass
%% n = 11; V_correct = 0.000000001917653; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 1.917652578913498e-09

14   Pass
%% n = 12; V_correct = 0.000000000117613; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 1.176128402893118e-10

15   Pass
%% n = 13; V_correct = 0.000000000006639; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 6.638786919642894e-12

16   Pass
%% n = 14; V_correct = 0.000000000000347; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 3.470781770983536e-13

17   Pass
%% n = 15; V_correct = 0.000000000000017; assert(abs(simplexvolume(n)-V_correct)<4*eps)

ans = 1.689800416129255e-14