Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Permutation-test/11l/permutation-test.11l
Normal file
23
Task/Permutation-test/11l/permutation-test.11l
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
V data = [85, 88, 75, 66, 25, 29, 83, 39, 97,
|
||||
68, 41, 10, 49, 16, 65, 32, 92, 28, 98]
|
||||
|
||||
F pick(at, remain, accu, treat)
|
||||
I remain == 0
|
||||
R I accu > treat {1} E 0
|
||||
R pick(at - 1, remain - 1, accu + :data[at - 1], treat) +
|
||||
(I at > remain {pick(at - 1, remain, accu, treat)} E 0)
|
||||
|
||||
V treat = 0
|
||||
V total = 1.0
|
||||
L(i) 0..8
|
||||
treat += data[i]
|
||||
L(i) (19..11).step(-1)
|
||||
total *= i
|
||||
L(i) (9..1).step(-1)
|
||||
total /= i
|
||||
|
||||
V gt = pick(19, 9, 0, treat)
|
||||
V le = Int(total - gt)
|
||||
|
||||
print(‘<= : #.6% #.’.format(100 * le / total, le))
|
||||
print(‘ > : #.6% #.’.format(100 * gt / total, gt))
|
||||
Loading…
Add table
Add a link
Reference in a new issue