Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168695
Image: ubuntu2004
def dadosd(d,n): dado=[[int(6*random()+1) for i in [1.. d]] for j in[1 ..n]] ndado=[] for e in dado: suma=0 for i in [0 .. d-1]: suma=suma+e[i] ndado.append(suma) sdado=[] for i in [d .. 6*d]: sdado.append((i,ndado.count(i))) g=Graphics() g+=points(sdado) for i in [d .. 6*d]: g+=line2d([(i,0),sdado[i-d]]) return g
@interact def _(d=(1,100,1),n=(1,100,1)): show(dadosd(d,n))
[removed]
[removed]
[removed]
[removed]