E LE neNr
s
0E LÔ 8e EcTtoN [E C-I
6 @r Testr t$Sa!3-3lrquets
ùec'rt§tts,
@ S
trr*p,hi ùa Crr. ,*.&*ÿçoa rr
of*rop'tl
O"î ù'iqtqt*o-$
t\/ 1r.s*l*Oa
F,tie. üc C*^ *.ùo* p
Àq|ùuc *''' i''odgti)= t'''
tsrr.. tÂr0I
= tr -r ) .
U b
1u^Ei.&^C eqle"o*,r"bgfoth."ry I.^ dt*o^ôt
âorc,*.rytÊ &
â{r" Éùâo$
eoih §t'u,sr,lùrdqr$i.ü .
c$o^o$ e. try,$f^
g: I tf
l+ t
.
St+
Q(Cl:Èsl 'Lqt*ù.1,. t.[ h+üii. ; d*. Otl
tel Sne.t§*t lq'Cûe$" )
1*.li1ud
to.dt
= tq,9tî ) ={*-r
t
I.L
liir
Gr," .,!,
to 1,ub,.!liikd puî.
.;o;1nl.L,o
A cæùt
qnr.t. o1;Êi*r
Ë 6 at,j
i$a.dcul3trûoqu î ( ci€.§r)= I
(.j.,!,Êr)
= e((iec,
ù (jc 6.rl.--t,àee;, *Il,
.5uun.)vtr [.r,\n I ?t ciect). l(cd€6tù er.8ll tqtci€ 6f t] er.6r) Y[t ['r,à! , l(t,tt 6t] .
P(\i€31]c,e sll r ltci e[r ùc* 60t)
Yht
[1,\] , l(tit6ri.{l (
ici,(.\cBl)t
1ctci,("}c 6r); n'j.= i
rtùh^o* l((à€rrl =.\i.l((itotl= i. '9rs
rl.ùn^u[
\* "uÀ..d* Unifu ..$o^o$ n t[ , l'-F
@ g ta'tuluùüû.{,ù,r p.}Eït.ùJIrr-
h1,ololfl'-h' l$,-ro*r o$o.J{i".- fo\ù{Ji -{q,".
. rttouTe
t o\ tü ,r^ r^p.l,'ot'c,.&
Qcol üa'r (q 11do..
rt.ro1[tdrt^ù 9t9tc))
ùor,[o,r]
Iloil'lur.ptriùe c . t({cl}=
"m= i 1 {rlq\u"ùi!d"6*,9rrr)
l11
tsït
31u^Ê.lleô"tcùâ ù c.ole-d
A '- üo1uüù{ù.'t}.r.ùâ'ql ' ;f= I''= i
'st
C^ùsù.
1('c;
e1(("Êc
l. l( lt.l
C 6)Ftù\rl.b$ 1('ciec
elc.tG");notr:
?(cj
ÉG e[(\ €G)ç ( Cr €61
î .llJl . g(ciËlùr*ccl=01{t;,("lCe}"
tù'ofù
Qrb
(r-{t.1}lc"Êc.l= #...;
@s
hl l(EcDql=1(
{[r Er,$],
er E c Gt ) =Ylt
6r,19, l(Ecctl
--l(
{[r
f,r,(ll,
ttECGI]= ?tq
û,
, E c61) )=
[_, t(
Ec 0tÉcel ù
G&.8à)tp(E EcBrlc.egt)+ gt ec6'r
(.
Êu{r.t cBt) t [
( E rr{Ç
(i)*= F'
6s.)
c
Gt$ cr
=6r)ùc*
e Bt)Ic6'g)= I *t.=-I
I g?tt Jrrt fr sutL.t urrrAd^r*,
çù",Àô-0r
e( e.co(1.{oit
T*. fnLi
u.^uiriu & [r,.-rü. trÀ{À. 1r',f ,
.}, c;eD1,=,lrl (cl
e0()t,,|rci€D()=
p({ciiiÉri
cDq); t #*
trrl § r 0uÏT
.itr ür.
4 todirû
L ?(olr,itorl
=.l! I
(
(ito() ùe.i
10,,,^tm,t" put* ro. uür
dc
[r,.-r0, go^t*..tp§,
t' âû..r§- cie
0{,oü
rs.i-.h.rn* ;oÉy"do*
.,r'c1ù
Q.,q^r na'.rLo*c*s,-§\6.§*Lr
Bo* qo.^.t
ûi{û^ôo$' .nrl^quJu.r ,c ùru.L
ür§t}' d;e.Io"ff
Soit3
un<.pùi uc.od€dÊ [r,x-r I
.n t
(c5 d o()=ilr,.
-i)
= (1-i)*o' udr
r,lcj (Dr)= r- l:§rpbr)-r-,\,y, cJr0",;r- Zt-'tI'
t*,rtt,L^tttot)
.o.,il
çqn l,ror, uifc. II
tni*t.c.:
"X"t f"$"^où
I,,l_.jdq,)=r + * t-,tàÀ,r(,)*"
-':î
.t?t {u'«t
='1+ }i''' *:''*}':i:::t*t,flï:1''
ô0,.. p(.lji §tf (
oq I =(r- ri)*tl,)-t '
Jeî tt; (nr)
rr.i
q.,ILeür t\ot*,.- qf.
Ar.â[;,.*- ci
ô0q d*i
e G'r' r-tllat;qtp"ô"$
1gl c.É0( ùuq I
(Dr.r(.r1.I(§.i
êD()i
,T,ptc,( 0ql=rÏ' ,'' ?(',i'l'r)l'tt -.*)
rorlàôul.À I
ttùb^S, l(
\-.{c.tl=t,.t'}'''. -r
;i
Etuüe ô un ornbrc ôetgtr
rrêctsroires ?0o r ôâbectcr loporrte- .@.$toitir^qha1lt, $à€ttl',
Qr-,'QL),ot Z tor',-QLl=1'
lsik
[etNt. et.,-u[: (r- i)'-' (.- i.,I* ) o co/r :r . *, ..'t'>,2'
't;rN*,
1,o,.,-ur): oo-eç : r-(t-iffrr(J-ii)*''=(.-i) ':
$ u- t.\*'t, I
-tor.{"Âtb,l*t ôrt*cf"d
ot.r -oratr"^Aüh + ll.to
tÇ'Z
l\. to1-,- QL I =1 .l:r
bJ .îct
ç Qo {uù0.ôc riptlic^ on cdE toî '(,
vqe Nf
tr
€tll Yrtf -o,lt,
F(r.l:o ù {lerN*,I.tEl,1r'L,
@ -el
to't[heru(, t(x,sL) = 1t ùl-{c"!) . (r-
È)'.: 'u1n'*"îf
."È\** !
nuJ,.o.,* (r+ qrc.0a'.J"*^ÊJ. [. sL ù ot. {(rf a.[q,
I
tts,^1uu^l. 1o,
do T*
Éi€
[.1,if , 0; =
1t'.1{g,u^(ü,oùo6
D1.lt"l$g^Â x.glr ,
0t ={("1o'ltiùte.qla"hyr"À{o; L ta
Da!ie 0r,tIl dr. ot.lt.l
\ Jr
rrü1.oyo.r$rr.
01'{t,,} ,
0i.{«"r q,'.Iiùt+r.fsrrùp*..Ft*
i€8,13$ûuc
)r"s& '!1 üoit{*e.hal^"'. tteNr, 1tx..&)=
Q&-,'0â..ôoiiL.r.lt-tti
.
1(À*:â)=
p( À"-rIl- t(x".(
T.r] = (1-F)'l'(.r-È,T'' t(f,r.tl.
(1-(i-,,t
)''')- tr -t1- Il)'''l
= ù1.,-Qà,p(x.:rr.I(Â.(ât= (r-
i)': (r- (r- i.) )-(,- (r-j,)'.)= o.-0,
tù.c.\§.0'9
h*qI.le ..
Nùor-T^*, vlrru , eâ=ç(x.>l.) i toùtuiàc^olui"ùüyr
ùqc
true, I*ttNr,
f (À.--&l. l(n.)à.ri-ltr.7&|
Ctqui u'a[ pf"or{Jesrr- .Eè § {sitnttNo. I&turosl*s}
'ù
t q! ùs;,r'.
lo,, Qoni. t ttni. ûâA
dstu
;
dr tr,w.Éâi i. â'*i
co"r^Xrta[sç
]-o, t t,
c(rl:o
[1, ptr[, F(t): L
lar (01.,-t1; - ao-h (t- \ fil t \''l
F(r.l= (J - -l
\'-
,.L?,
30
I
rle
trtt&etN / û[, J-tl-
l-t I . .t.l
â. à [:, tri)'; à
ld..
i..
, Ll,Li,ç,ti' È
t-r.,,f
=',
.t o^t ,r.S"
ù
!ou..st rt'l él 3
.11
eor"
k"I
it [ir,.-,1
,*Lil L'.,t,ri'' rà LqôtL
ürT...
A& =h
J,iÂür\hrcÉü.0 à ,t.uq$*
ï.: '< /§rârÀ{'-dL''hL
I Ç'.,t-,)i''+
o^rd !El l.è
ROo.tptr.-
r. C" purù) qurti*où,^\-
Q[*t'n-t'
,à
!l
8'ator. ccl.^rr !!t.-
xc\u". ù"o.r.tey
rr(rlerN . eut.iÉ6h.,m hflù
O. T.e.
l(À >[ttr."aç.
L §,
q\q.
È\Àt. ,it,^,
Af I
(Ure*r
tr ûi.e- ...**Àir.
IdukqÊN..
vtÊL -lr" Lr,^..r)
=io(qr.,-orl
=i IQû,- l'u.=T(Ê*)oi-
L.r' ri - 'i-, -'
t=rq-r
f--t
0roq iral - l*"* t àu, = à.,o - lot
Z
I ptx.--[] =f,= r â=o lt'
t
urroh ù*1rr''ôn^où^r^ 1r,e,
*k.\§1 =
or-l .
1o\=.;: ,*L.,t-','''fr
{ùÿ* t
""* I
o.( +.< ril rl + 1,*t,^[te
b,u'tJl& tÀ I =o ùut ti
q oq: o
(corrct'it^
1rt. {1
Qt,to'
'ôr q$ 1qry
q-r
dr tu-r Inilt yi
tourriU't'
o Irè
^
U (I qt-10\\= ,1 ot
.o-Qo.r*^''ù trn^cql.ât!t5 a[tu'^XËe''
Ï:. .ü lr?(x,.'01= lut ' ..ul\r,'r-q,*!"É;
d" te't^.Êdâ"0\x +o L= I l;o
àp(f,.--(lqt
ro",r^fedq^.- .I"à.r-E*.o*^1&-
t[1tÀ..ti) o) J
t1ur-î
u pç,.,..1. l=ïo"
{c
J*J
LrÂ.lef;te ,h e\^")=Èoon .
, , ^
pæ
@ E r€N+, {r
err., T,*u
1.(,-e'tlt
--r- i.,,lu')rdt' = à tll'1r'i'rt
îôtcs
ü.ru^r,ç.. ôr 1"i,,*,0,
rÂu§hr^uôn,""Y\.nc-
dcJj:-t'dt-?*tq'f te fl'9Il
toir
Èerlr,nrr
. \rt€rRr , J.r.*ôr =t+T:= È-f1 hJi t*o*=d
.J.. Z
toot l.o
l'ot
=l:o
=
à:[l,u',"]Ç]'
.â'[l,u,r,''ft;,
1.,
ltou
aci qnurcôq^ctrcq^açu,.
ù J.%-" dr
pu.borrl l-e[r
,11]dc..* Jî,ttldt
rt
tq.
è^c.orïu
,Ct..
{1Ct}lr,D
.llçtt'0,= l,
a?
= Ë,(t-,f'
(rt*,,*T
l1
E'
!l
8oi\ 1€ rNt.rJte 0r
,
f6,Gr-!rtr): (r-ctJ?-(r-e'')?'l
(r-e-u)Pdt.
?ar^
§rrc\uÂl t.r+ # (1'e't)?t'
attlc.lrÀihù.e trr; lt
,*fR+ 'Dus rt.r.rr.
Iî1,.,!,'-tr,ql dt
=-k lft
(r-e{}r'i i
(J-i')t'J
üur
I1r, -31. a
'ùoil r c lN
\)r3'
1+ J1 Ia =L
t=tr-l
tf r,f*'i =
1Jr.r
=Z trp+,-I1) tf t
s?.1 \-a r-è
ôqt 1r.,= L r+1-- L
?--r llt l.o
a&(*"§.
oo^r* ollcqr- Çorrru:à
(^q. I1=5. .r-l
cr.- Vr.tlllt-ltl, 1*., -- L l-.Jt:+-".' '
p--f ? " 'r''I
lJ
B/ehùr§.I^^! :*
j+-. +!
^,, Q^'r-ll k1d
ôq*,<t* i +'-
r** t
ertôi,^ù"[
j"^lRl+. toit uc
lrÎ ù v7. L'ït€fr.,..,r,1 , + i à ; tq.co,^ye$, \:'Èdt-§ï==J.
Ytec".-r,-J, ir.à ; torco..aqo$, J*,,ioo
iù *
'rùqls*ü$.
Yr.e til- ro,â1,J:'+ . j .l:,+ r&u.îr{'ü"{fqlf("rflLP
. -
fu\*cuù*)).
a--,I['"1!.Ï:
u' r - ..r L ' -L t) J.+ (J.-ri {nrr1..r
i i ( î \' { ,. \'b= h(*.r} r"., -
1 .< [.r..rrt:! f.lt' i:è dr'l t J1 b ,
vr-LTt l=r lrlr.
I
?tt Irl
f
P
t
t^-r t^(r.-,t.,
0".
I(l
t.^
*tl tL(r--:-)])= r.
\lrtr
t;
=l+ 'htttr'.t
- --
&t L t'
§.-..,
L*
ôc.<. t*.^ $ Î,u.r s Lt..rlrt i *doos&,c.qrtolrru=l- (fyr)
rùÀfr.o$ ,
Vr€lN-torr),
Y*C tI- I o,.r I
.
t^.u
-( .I",,-,.(
et
t.tx-,;1-(
a.-,t"x tr(..'rt
t
.t.
t,
tu vr,?tr^ t-todrO.l$
.
\!.totù
ü.
* P.t,.* )(,.
uppJ.- (r*1..-*i
-9J tuitrtÊtttù*r,t.
t . ).2,, .Yt
1*eYd6.*
ùh
n.^ tR 1ù
{u G tt .,
g\ut =YuetE* ,
T'"(al. - (r-rl1",
(l
-i)''t
.( o .dsit t t tx
i.
X at0ür.oüo.h
at
Et'r,tl
ôr.c \(tt ..\1,[,",ù
-(]tt'rl
u[r,N' / oq . \:,qtt
rù( \&.rr
v i rtN, 1",it =u,)
\
1-lZ qt., , Iut
{. r l:o
L* {t
tr
-
vot"
Lt- (
E([")
§tü rr.r . krii I-,, + !^" t
rt{t t n \xr-\ te"u
tn^q It«r^ e-to.&*-Ef-
, ti Lu etr.; :
1\e*o { ,..
C. q ùc.c Jt.r e^^ thè E(f,rl
t
etX.l(.n t^^
*
G
LuI"* v tru
ato'püg)
E(l(.i 'r, h* b .
&e
r-Lrt
À.-- f -lF
r.l rL
I
@':i:i';i
Xc+ \rtrl
L E(Y-i=E
rYtc
[,r,.1] ,
f(Y. Ll. x'l -^>,\ r-À\.t \-t ( eD,.E (1")
r, à
çtlû\s..É :
sJ t.*t*,uJ1i,...[
.r"t,
qs.
s â j,"\turou =Jltutüu
's$ev- â
tn, -
Jrt\utut&rs l' o,
.q
Jlr,",o.. {..'1.-,' i.,q, ):i,1
(1-e-t)"''J iî . ü r.-,(tLa)
,ht,tLr)=+o :.* ,*- J: tt.rdu= ü.'*-, ;
ûrù,.
- u !"r, G i'n,
=e(Â*) ; r§ àot = E(x'l-oo =E(x')-a
ir++.
(=s \xrr
t=o?ru to^*'qrr.e.* trt-tud,.sr^rll-l'i
dü'$
ùur
, a' trù"$ tut^^ 1 u'rrta
:E(x.l-, s #(Er^*).
lJ ++ S Etx.)( 'iï., ot!orrc
cJ:{"f
§
3..,
-{
&tu
:L (
\rua'c & teF(o-.d*,h
0rElÉ.- @
.rr.rr (-t-t
r))(,-
i)'i.}.'
1nohùit,tùoÙ" 1u. 11r..
tI. \tthtr-lt,r)
..J[,",n" s1t-r(l'(1,:
t- Ltt
Itlo..
t*I o,*ih
qlu :ù etx"t
er H, \, *irà ,..§,H,
=o!J
Qur^r,- loo '
F (Y*l = SQS 'î, l6ss * ft
.(1't6!q üut' '
r'qogl S Etr't ( t'
?our
rr=iooo ' E(Y\l:
S0orS-
lô,1118
l*610,1319 .il=, ûq't ' to'i5r8 ( E(T'l (Jl'tgît (f g!
ÿS,t}îtt}
Sts - * y l,tsg 3ï
6tlo '
JgSS JTrlEttlore l'
llu-:
4n t" tor191tct tso i ü*s'(qtï"È htr =6'6\35
1t-\§
:9'9sSBlo'ɧ,oûs
a q[ üa-c tÀ P1ü"t*^" " ôtU
tr n rorxaLclgg.
.-
$ù.g,$-: r. frù"§€^- gq ù[kcl^e.dt h
luru^c-t! {.-
etcum^c'ca ? lotQotlcttûfr^ ,
1oi^eto'r1ra'nc- ùr
"hLd€, ttü.orrùe"
1ur.uile,)c.topr^a .
anrlorr'r-*- t
E(^"1 'J.,
ôe{sd3
to.rc§s, dr . Et'"t!,i.JoL \t>.Ll
,.r. - ù0uolds È.
"0.§.- p o. cÂ\c&q-" '
3..
lt
ôoit (æ,-^^: !t
\r..t+'*o11l:5Ô È(^')
!J tr '^oLr
ùr' kb Jotoiæa
![Epr"*-'
?o.
ü tJe.
topo.*e-,l 0^l* ôilcùL SJ
Lt u..6r..r' asûdhi Ft.idtd'''
HEC
86 @
program HLcëbv1;
var n, i
' c, h, b, x: i nteger;
var a:array[1..999] of integer;
begtn
c'lrscr; randgmt ze;
rePeat
write(,Donnez re nomDre n de circurts (z<=n(=1000) ');readin(n):write'ln;
until (n>1) and (n<1001);
for i:=1 to n do a[i]:=1;
c: =n-1 ; h: =0;
repeat ^! L ,
h:=h+1; r:=Û; wllte('la partle D''h" conttent');
repe at
b:=ranciom(2);
1;=1+1i rf aIr]=1
the n begtn
x:=random(2);
tf ((b=1)and (;<=O))or (tb=0) and (x:1)) thenbegin
a-r:'=fr;C:=c-1;
end;
unttl eno;((''l )=n-1) or (c=C));wtl-:eln('
"c*1:3" éiément(s)');
unttl c=0;
wrrte( .Le nomDre oe tests pour oetec.-er la panne est . , ,h );
end
Donnez le
'i a part'l e
i a Dart'r e I a part'l e 1a part're la pa.t'le
I a partle
'l a pa.t'r e la partre
I a par!'l e la partre Le nombre
nornbre n de clrcuits (2<:n D1 cont'len! 505 élement'ts) DZ ccî-'tetrt 240 elément(s) D3 ConttenL 11J élernen!(S;
D1 conr'rent, 58 élerren-"ts) D5 cont I eô" 34 é térnen! ( s ) D6 corrt,tent 20 élémen'"(s) D7 conf,tent I élément(sl Db contren! 5 élem=n'-(s) E9 ccn!rert 2 élémen'"(s) D1O cont'lenL 1 élérneni(s de tests PCur- de-'ecter I a
)
pa.lne. est : 1û
C,,onnez I e i a par!'t e
I a partte
I a part't e la oartre
a parti e a partre a pa.tie a part'1 e
nombre n de c'lrcutts \2('
D 1 cot-r'u I ent 240 é'l ément (
ù2 contrent 124 é'lemen-"(
D3 contrent 54 élément(
D4 contlent 26 élémentt D5 contlent 11 élément(
D6 contrent 6 é'lémen'"(
D7 cont t ent 4 é1 ément i DE cont'ten! 1 éléne:ttt de tes!s DC J r de'-e3t-e r
=11 ..=1UU'J) 5UU
qi
s)
cl c1 S) c, l
QJ
= ^1^nê êc:
Le nomDre
program HEC86V2,;
var n, i rcrhrhl rbrx,tru:
Yar a:alrayl1..999] of
begi n
cl rscr; randomi ze;
repeat
write( 'Donnez unti'l (n>1) and
wrrte('Comoien u:=0;c'1 rscr;h1 reoeat
g;=Ll+1i
for t:=1 to n do c:=n-1;h:=0;
,YrZrP:fgaj;
crrcurts (2<=n<=1000)' );readln(n) ;
vous recommencer'la cjétectron' );read(t);
((b=0t and (x=1)) a[t]:=1:
2J:ano (x=0t) cr
. a -a-1.
. U, -v
1 ,
^. la:l-, r )'
1-y;P::1;
n-'1 do P:=9*zi ).exp(-8x1n(10));
mémct re 'l ' 'êsDér-ance est- senst o temert : integer;e,e1
r ntege r ;
le nombre n oe
(n<1001 );
cie f ot s voul ez
repeat
h:=n+1;t:=0;
repeat
b:=randomt.2t;
1:=t+1;
rf a[r]=1 then begtn x: =rancoml
tf ((D=11
trren begrn a[ t ] : =Ü
eno:
ond .
unt'l I ( ( t ;'=n- unt ''l I c:0 :
h'l :=h1+n:
unttl u;=tl
wrlteln('1.l Y a ',h,' clrcutts ');
wr'tte-l n('Notrs avcns reccmmencé',t,' fots la oétect'lon');
wrrteln('Le nombre mcyen de tests DOur détecter la panne est :
"h1/L:3:7):
et:=1;y:=1;
repeat e:=e1;
Y:=0.5*Y;z:=
foll:=1 to
e'1 :=e+1-P:
untt I abs( e1 -e wrtte''ln('Pour
eno.
,e1 :3:9)
I1 y a 100 circu'its
Nous avons recommencé 1O fois la détection
Le nombre moyen de tests pour détecter 1a panne est:8.0000000 Pour mémoi re 'l 'éspérance est sens i b'lement : 7 . 96937 4524
I'l y a 1O0 circuits
Nous avons recommencé'100 fois 'la détection
Le nombre moyen de tests pour détecter'la panne est:7.6600000 Pour mémoi re 'l 'éspérance est sensr bl ement : 7 . 96 937 4524
I'l y a 100 circurts
Nous avons recommencé 500
Le nombre moyen de tests
Pour mémot re 1 'ésPérance
fots la détectron
pour détecter la panne est :8'2980000 est sens t bl ement : 7 . 96 937 4524
1l Y a 1000 circutts
Nous avons recommencé 1 0
Le nombre moyen de tests Pour mémot re j 'ésPérance
1l y a 100Ù clrcu'lLS
Nous avons recommencé 1 00
Le nombre moyen de tests
Pour mémot re I 'ésPérance
fcts ia détectton pour détecter 1a est senst biement
panne est :11.4000000
: 11.297809991
fots la détectton
pour dé+-ecter I a panne est :'l 1 .3400000 est sens'lDlement : 11.297809991
1l v a 1000 c'lrcutts
Nous a\/ons recommencé 1OÛ0 fots la détectton
Le nombre moyen oe tests pour détecter 'la panne est :11'3890000
pour mémor re I ',éspérance est senst bi ement : 1 1 . 297u0999 1