diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-18 20:55:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-18 20:55:39 +0000 |
commit | ddafe43016562ea7dd628862d57f4975b1e68940 (patch) | |
tree | 0082e06a29603626c89950b52f4550bee7472568 /Master/texmf-dist/tex | |
parent | ae700fb14d17b4bbf3394af2a4a58b659561b53c (diff) |
proflycee (17oct22)
git-svn-id: svn://tug.org/texlive/trunk@64745 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty | 163 |
1 files changed, 160 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty index f869d6dc802..b4651856e79 100644 --- a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty +++ b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty @@ -3,9 +3,11 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2022/10/12 v1.3.3 - Aide pour l'utilisation de LaTeX en lycee] -% 1.3.2 Ajout de commandes pour des arbres de probas classiques, en tikz -% 1.3.1 Correction d'une commande liée à la conversion bintohex (suppression clé trait) +\ProvidesPackage{ProfLycee}[2022/10/17 v1.3.5 - Aide pour l'utilisation de LaTeX en lycee] +% 1.3.5 Correction de bugs sur les calculs de probas (loi géométrique) +% 1.3.4 Ajout des calculs de probas geomtriques et hypergeometriques + petits schémas probas +% 1.3.3 Ajout de commandes pour des arbres de probas classiques, en tikz +% 1.3.2 Correction d'une commande liée à la conversion bintohex (suppression clé trait) % 1.3.1 Ajout d'une option pour ne pas afficher les bords des cases en pixelart % 1.3.0 Ajout d'une commande pour mettre en forme une conversion depuis la base 10 % 1.2.9 Correction d'une incompatibilité avec simplekv (clés vides...) @@ -2240,6 +2242,32 @@ {} \xintFloatToDecimal{\xintfloateval{add(binomial(#1,i)*#2^i*(1-#2)^(#1-i), i=\BorneInf..\BorneSup)}} } +\newcommand\calcPgeomP[2]{%pk + \xintFloatToDecimal{\xintfloateval{(1-#1)^(#2-1)*(#1)}} +} +\newcommand\calcPgeomC[3]{%pab + \def\BorneInf{#2}\def\BorneSup{#3} + \ifthenelse{\equal{#2}{*}}% + {\def\BorneInf{1}} + {} + \ifthenelse{\equal{#3}{*}}% + {\def\BorneSup{\fpeval{trunc(1/#1*10,0)}}} + {} + \xintFloatToDecimal{\xintfloateval{add((1-#1)^(i-1)*(#1), i=\BorneInf..\BorneSup)}} +} +\newcommand\calcPhypergeomP[4]{%Nnmk + \xintFloatToDecimal{\xintfloateval{binomial(#3,#4)*binomial(#1-#3,#2-#4)/binomial(#1,#2)}} +} +\newcommand\calcPhypergeomC[5]{%Nnmab + \def\BorneInf{#4}\def\BorneSup{#5} + \ifthenelse{\equal{#4}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#5}{*}}% + {\def\BorneSup{#1}} + {} + \xintFloatToDecimal{\xintfloateval{add(binomial(#3,i)*binomial(#1-#3,#2-i)/binomial(#1,#2), i=\BorneInf..\BorneSup)}} +} \newcommand\calcPpoissP[2]{%lk \xintFloatToDecimal{\xintfloateval{exp(-#1)*#1^#2/factorial(#2)}} } @@ -2312,6 +2340,60 @@ } } +\NewDocumentCommand{\numPgeomP}{ s O{3} m m }{%*=sci,2=prec,3=p,4=k + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round((1-#3)^(#4-1)*(#3),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round((1-#3)^(#4-1)*(#3),#2)}}} + } +} + +\NewDocumentCommand{\numPgeomC}{ s O{3} m m m }{%*=sci,2=prec,3=p,4=a,5=b + \def\BorneInf{#4}\def\BorneSup{#5} + \ifthenelse{\equal{#4}{*}}% + {\def\BorneInf{1}} + {} + \ifthenelse{\equal{#5}{*}}% + {\def\BorneSup{\fpeval{trunc(1/#3*10,0)}}} + {} + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add((1-#3)^(i-1)*(#3), i=\BorneInf..\BorneSup),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add((1-#3)^(i-1)*(#3), i=\BorneInf..\BorneSup),#2)}}} + } +} + +\NewDocumentCommand{\numPhypergeomP}{ s O{3} m m m m }{%*=sci,2=prec,3=N,4=n,5=m,6=k + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(binomial(#5,#6)*binomial(#3-#5,#4-#6)/binomial(#3,#4),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(binomial(#5,#6)*binomial(#3-#5,#4-#6)/binomial(#3,#4),#2)}}} + } +} + +\NewDocumentCommand{\numPhypergeomC}{ s O{3} m m m m m }{%*=sci,2=prec,3=N,4=n,5=m,6=a,7=b + \def\BorneInf{#6}\def\BorneSup{#7} + \ifthenelse{\equal{#6}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#7}{*}}% + {\def\BorneSup{#3}} + {} + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#5,i)*binomial(#3-#5,#4-i)/binomial(#3,#4), i=\BorneInf..\BorneSup),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#5,i)*binomial(#3-#5,#4-i)/binomial(#3,#4), i=\BorneInf..\BorneSup),#2)}}} + } +} + \NewDocumentCommand{\numPpoissP}{ s O{3} m m }{%*=sci,2=prec,3=lbda,4=k \IfBooleanTF{#1}% {% @@ -2832,4 +2914,79 @@ \end{tikzpicture} } +%==============SCHEMASPROBAS============= OK! +%densites utiles +\def\densnorm#1{1/(sqrt(2*pi))*exp(-0.5*(#1*#1))} +\def\densexpo#1{exp(-#1)} + +\defKV[GRPHPROBCONTINUES]{% + CouleurAire=\def\GRPHPROBcoulsurf{#1},% + CouleurCourbe=\def\GRPHPROBcoulcbe{#1},% + Largeur=\def\GRPHPROBlarg{#1},% + Hauteur=\def\GRPHPROBhauteur{#1} +} + +\setKVdefault[GRPHPROBCONTINUES]{% + CouleurAire=LightGray,% + CouleurCourbe=red,% + Largeur=2,% + Hauteur=1,% + AfficheM=true,% + AfficheCadre=true +} + +\NewDocumentCommand\LoiNormaleGraphe{ O{} D<>{} m m m m }{%1=options,2=optionstikz,3=m,4=s,5=a,6=b + %simplekv + \useKVdefault[GRPHPROBCONTINUES]% + \setKV[GRPHPROBCONTINUES]{#1}% + %unites + \def\UNITEX{\fpeval{\GRPHPROBlarg/8}}\def\UNITEY{\fpeval{\GRPHPROBhauteur/0.5}}% + %bornes + \def\BorneInf{\fpeval{(#5-#3)/#4}}\def\BorneSup{\fpeval{(#6-#3)/#4}}% + \ifthenelse{\equal{#5}{*}}{\def\BorneInf{-4}}{}% + \ifthenelse{\equal{#6}{*}}{\def\BorneSup{4}}{}% + %tikzpicture + \begin{tikzpicture}[x=\UNITEX cm,y=\UNITEY cm,#2] + \ifboolKV[GRPHPROBCONTINUES]{AfficheM}% + {\draw (0,-0.0375) node[font=\tiny,scale={2*\UNITEX}] {#3} ;} + {} + \ifboolKV[GRPHPROBCONTINUES]{AfficheCadre}% + {\draw[Gray] (-4,-0.075) rectangle (4,0.425) ;} + {} + \clip (-4,-0.075) rectangle (4,0.425) ; + \draw[black,semithick,fill=\GRPHPROBcoulsurf] ({\BorneInf},0) -- plot [domain={\BorneInf}:{\BorneSup},samples=100] (\x,{\densnorm{\x}}) -- ({\BorneSup},0) -- cycle; + \draw[thick,->,>=stealth] (-4,0)--(4,0) ; + \draw[thick,densely dotted] (0,0)--(0,0.39894) ; + \draw[thick,domain=-4:4,samples=100,\GRPHPROBcoulcbe] plot (\x,{\densnorm{\x}}) ; + \end{tikzpicture} +} + +\NewDocumentCommand\LoiExpoGraphe{ O{} D<>{} m m m }{%1=options,2=optionstikz,3=l,4=a,5=b + %simplekv + \useKVdefault[GRPHPROBCONTINUES]% + \setKV[GRPHPROBCONTINUES]{#1}% + %unites + \def\UNITEX{\fpeval{\GRPHPROBlarg/4}}\def\UNITEY{\fpeval{\GRPHPROBhauteur/1}}% + \def\MOYENNE{\fpeval{trunc(1/#3,0)}}% + %bornes + \def\BorneInf{\fpeval{#3*#4}}\def\BorneSup{\fpeval{#3*#5}}% + \ifthenelse{\equal{#4}{*}}{\def\BorneInf{0}}{}% + \ifthenelse{\equal{#5}{*}}{\def\BorneSup{4}}{}% + %tikzpicture + \begin{tikzpicture}[x=\UNITEX cm,y=\UNITEY cm,#2] + \ifboolKV[GRPHPROBCONTINUES]{AfficheCadre}% + {\draw[Gray] (-0.2,-0.15) rectangle (3.8,0.85) ;} + {} + \clip (-0.2,-0.15) rectangle (3.8,0.85) ; + \draw[black,semithick,fill=\GRPHPROBcoulsurf] ({\BorneInf},0) -- plot [domain={\BorneInf}:{\BorneSup},samples=100] (\x,{0.7*\densexpo{\x}}) -- ({\BorneSup},0) -- cycle; + \ifboolKV[GRPHPROBCONTINUES]{AfficheM}% + {\draw (1,-0.075) node[font=\tiny,scale={\UNITEX}] {\MOYENNE} ; + \draw[thick,densely dotted] (1,0)--(1,{0.7*\densexpo{1}}) ;} + {} + \draw[thick,->,>=stealth] (-0.2,0)--(3.8,0) ; + \draw[thick,->,>=stealth] (0,-0.15)--(0,0.85) ; + \draw[thick,domain=0:3.8,samples=100,\GRPHPROBcoulcbe] plot (\x,{0.7*\densexpo{\x}}) ; + \end{tikzpicture} +} + \endinput
\ No newline at end of file |