re,
ok, je viens de le faire, l'erreur et l'erreur est sur la ligne ou il y a d2 aprés DropDown "MENU".................................},d2
je fais quoi aprés ?
merci
(p,q)
Prgm
Local st”,sta,stb,stc,ch,d1,d2,d3,e,proba,prpapq,prpetq,diagra,valeur
Define proba(p,nonp,a,b)=Prgm
Local st
"p("&p&")="&string(a)&"/"&string(b)&"="&string(round(a/b,3))&" "st
While dim(st)<19
st&" "st
EndWhile
st&"p("&nonp&")="&string(b-a)&"/"&string(b)&"="&string(round((b-a)/b,3))st
Disp st
EndPrgm
Define prpetq(p,q,a,c)=Prgm
Disp "p("&p&""&q&")=p("&p&")*p("&q&"/"&p&")="&string(a)&"/"&string(”)&"*"&string(c)&"/"&string(a)&"="&string(round(c/”,3))
EndPrgm
Define prpapq(p,q,b,c)=Prgm
Local st
"p("&p&"/"&q&")=p("&p&""&q&")/p("&q&")"st
If dim(st)>20 Then
Disp st
"p("&p&"/"&q&")"st
EndIf
st&"="&string(round(c/”,2))&"/"&string(round(b/”,2))&"="&string(c)&"/"&string(b)&"="&string(round(c/b,3))st
Disp st
EndPrgm
Define diagra(e,p,q)=Prgm
Local l,l2,i,j,nb
Output 1*8+2,6*(5+e),p
For l,2,6,2
Output l*8,6*(4+e),"___________"
EndFor
Output 3*8,e*6,q
For l,3,6
For l2,3,15,6
Output l*8,(l2+e)*6,"|"
EndFor:EndFor
For i,1,3
For j,1,3
m[i,j]nb
If e>0 Then
round(nb/”,3)nb
EndIf
Output (2*i+1)*8,(j*6-2+e)*6,string(nb)
EndFor:EndFor
EndPrgm
Define valeur(ch)=Func
Local a
If ch="" Then
0a
Else
expr(ch)a
EndIf
If a<0 Then
0a
EndIf
EndFunc
1d1
1d2
1d3
Lbl donnee
Dialog
Title "Probabilités conditionnelles"
Request "Effectif total “ ",st”
Request "Effectif de "&p,sta
Request "Effectif de "&q,stb
DropDown p&" et "&q,{"Effectif "&p&""&q,"Proba p("&p&""&q&")","proba "&p&" sachant "&q,"proba "&q&" sachant "&p},d1
Request p&" et "&q,stc
EndDlog
int(valeur(st”))”
int(valeur(sta))a
int(valeur(stb))b
valeur(stc)c
If d1=2 Then
”*cc
EndIf
If d1=3 Then
b*cc
EndIf
If d1=4 Then
a*cc
EndIf
exact(c)c
Lbl caroll
ClrIO
Disp "Diagramme de Carroll"
newMat(3,3)m
cm[1,1]
b-cm[1,2]
bm[1,3]
a-cm[2,1]
”-a-b+cm[2,2]
”-bm[2,3]
am[3,1]
”-am[3,2]
”m[3,3]
diagra(0,p,q)
diagra(20,p,q)
Disp
If a>” or b>” or c>a or c>b or a+b-c>” Then
Disp "Trop grand, erreur de saisie"
Pause
Goto donnee
EndIf
Pause
Lbl probas
proba(p,"non"&p,a,”)
proba(q,"non"&q,b,”)
proba(p&""&q,"ñ"&p&"ñ"&q,c,”)
If d1œ2 Then
prpapq(p,q,b,c)
prpapq(q,p,a,c)
EndIf
If d1=3 Then
prpetq(q,p,b,c)
prpapq(q,p,a,c)
EndIf
If d1=4 Then
prpetq(p,q,a,c)
prpapq(p,q,b,c)
EndIf
proba(p&""&q,"ñ"&p&"ñ"&q,a+b-c,”)
Pause
Lbl menu
{"réussite","échec"}ch
Dialog
Title "Fin du programme"
Text "Que faire ?"
DropDown "MENU",{"Modifier données","Diagramme de Carroll","Probabilités","Variable aléatoire","Terminer"},d2
Text "Nature de la variable aléatoire"
DropDown p&" et "&q,ch,d3
EndDlog
If d2=1 Then
Goto donnee
EndIf
If d2=2 Then
Goto caroll
EndIf
If d2=3 Then
Goto probas
EndIf
If d2=4 Then
ClrIO
ch[d3]ch
Disp "Exactement 2 "&ch&"s : "&p&""&q
Disp "Au plus 1 "&ch&" : non"&p&"non"&q
proba(p&""&q,"ñ"&p&"ñ"&q,c,”)
Disp "Exactement aucun(e) "&ch&" : non"&p&"non"&q
Disp "Au moins 1 "&ch&" : "&p&""&q
proba("ñ"&p&"ñ"&q,p&""&q,”-a-b+c,”)
Pause
Disp "Exactement 1 "&ch&" : ("&p&"non"&q&")(non"&p&""&q&")"
proba("{"&p&"ñ"&q&"}{ñ"&p&""&q&"}","{"&p&""&q&"}{ñ"&p&"ñ"&q&"}",a+b-2*c,”)
Disp "Aucun ou exactement 2 "&ch&"s : ({"&p&""&q&"}{ñ"&p&"ñ"&q&"}"
proba("{"&p&""&q&"}{ñ"&p&"ñ"&q&"}","{"&p&"ñ"&q&"}{ñ"&p&""&q&"}",”-a-b+2*c,”)
Disp "2 "&ch&"s sachant que 1 "&ch
Disp "est réalisé"
prpapq("{"&p&""&q&"}","{"&p&""&q&"}",a+b-c,c)
Pause
Goto menu
EndIf
Lbl fin
DelVar a,b,c,”,m
EndPrgm