| |
|
|
p.specht
| for the application the Formel of Faa di Bruno [...] was one Multinomialkoeffizient to program. Klappt integrally well, because Bereichsüberschreitungen weitestgehend vermieden go.
Window Title " M u L T I n O M I A L k O E F F I Z I E n T"
declare w$,z$[],anz&[],c$,i&,n&,flg&:CLS:font 2
print "\n The procedure accounts The amount different aussehender \n"
print " orders all characters, where some characters too repeatedly\n"
print " appear (= groups un-unterscheidbarer characters form) can.\n"
again:
Print "\n\n give tappt im dunkeln a Zeichenkombination one: ";:input w$:case w$="":end:n&=-1
Whileloop len(w$):c$=mid$(w$,&Loop,1):flg&=1
whileloop 0,n&:i&=&Loop:if z$[i&]=c$:anz&[i&]=anz&[i&]+1:flg&=0:break:endif
endwhile:if flg&:inc n&:z$[n&]=c$:anz&[n&]=1:endif
endwhile:print
:whileloop 0,n&:print " ";z$[&Loop];" comes ";anz&[&loop];" time to.":endwhile
print "\n therefore there ";
print stature$("#################",multinomkoeff(len(w$),n&,anz&[]));" unterscheidbare orders!"
waitinput:cls:goto "nochmal"
proc multinomkoeff :parameters k&,n&,anz&[]:declare p!:p!=1
:whileloop 0,n&:whileloop anz&[&Loop]:p!=p!*k&/&Loop
dec k&:endwhile:endwhile:return p!
endproc
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/20/21 ▲ |
|
|
|