Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
Module Checkit {
|
||||
Global data(), treat=0
|
||||
data()=(85, 88, 75, 66, 25, 29, 83, 39, 97,68, 41, 10, 49, 16, 65, 32, 92, 28, 98)
|
||||
Function pick(at, remain, accu) {
|
||||
If remain Else =If(accu>treat->1,0):Exit
|
||||
=pick(at-1,remain-1,accu+data(at-1))+If(at>remain->pick(at-1, remain, accu),0)
|
||||
}
|
||||
total=1
|
||||
For i=0 to 8 {treat+=data(i)}
|
||||
For i=19 to 11 {total*=i}
|
||||
For i=9 to 1 {total/=i}
|
||||
gt=pick(19,9,0)
|
||||
le=total-gt
|
||||
Print Format$("<= : {0:1}% {1}", 100*le/total, le)
|
||||
Print Format$(" > : {0:1}% {1}", 100*gt/total, gt)
|
||||
}
|
||||
Checkit
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
Module CheckThis {
|
||||
Function CombinationsStep (a, nn) {
|
||||
c1=lambda (&f, &a) ->{=car(a) : a=cdr(a) : f=len(a)=0}
|
||||
m=len(a)
|
||||
c=c1
|
||||
n=m-nn+1
|
||||
p=2
|
||||
while m>n {
|
||||
c1=lambda c2=c,n=p, z=(,) (&f, &m) ->{if len(z)=0 then z=cdr(m)
|
||||
=cons(car(m),c2(&f, &z)):if f then z=(,) : m=cdr(m) : f=len(m)+len(z)<n
|
||||
}
|
||||
c=c1
|
||||
p++
|
||||
m--
|
||||
}
|
||||
=lambda c, a (&f) ->c(&f, &a)
|
||||
}
|
||||
treated=(85, 88, 75, 66, 25, 29, 83, 39, 97)
|
||||
placebo=(68, 41, 10, 49, 16, 65, 32, 92, 28, 98)
|
||||
treat=0
|
||||
m=each(treated): while m {treat+=array(m)}
|
||||
total=1
|
||||
for i=len(placebo)+1 to len(placebo) +len(treated):total*=i:next i
|
||||
for i=len(placebo)-1 to 1: total/=i:next i
|
||||
d=total div 10**int(log(total))
|
||||
k=false
|
||||
StepA=CombinationsStep(cons(treated, placebo),len(treated))
|
||||
counter=0
|
||||
gt=0
|
||||
While not k {
|
||||
comb=StepA(&k)
|
||||
accu=0
|
||||
m=each(comb)
|
||||
while m {accu+=array(m)}
|
||||
gt+=if(accu>treat->1,0)
|
||||
counter++
|
||||
if counter mod d=0 then Print over str$(counter/total," #0.0%"): Refresh 1000
|
||||
}
|
||||
print over str$(counter/total," #0.0%")
|
||||
print
|
||||
lt=total-gt
|
||||
print Format$("less or equal={0:1}%, greater={1:1}%, total={2}",lt/total*100, gt/total*100, total)
|
||||
}
|
||||
CheckThis
|
||||
Loading…
Add table
Add a link
Reference in a new issue