%!TEX program = pdflatex
%!TEX encoding = UTF-8 Unicode 
%!TeX root=../simple.tex
%---------------------------------
%  
%---------------------------------
\element{ALG-INEQU-INTERVALLES}{ 
\pyc{[a,b,c]=random.choice([
[2,9,5],  
[-1,9,-5], 
[2,-3,4], 
[-4,-3,-7],  
[-3,-8,-2],  
[-1,-3,0], 
])} 
\pyc{s1=random.choice(['>','<','<=','>='])} 
\pyc{[s2,s3]= random.choices(['<','<='],k=2) if b<=c else random.choices(['>','>='],k=2)}  
\begin{question}{ALG-INEQU-INTERVALLES.q01a} \hfill \\
% Question simple à réponse simple    
L'ensemble des nombres $x$ tels que \pyc{print("$"+sp.latex(eval(f'x'+ str(s1)+f'{a}')).replace("\leq", "\leqslant").replace("\geq","\geqslant")+"$")}  se note :   
\AMCBoxedAnswers
\begin{reponseshoriz}
\pyc{print("\\bonne{$\interval[open left]{-\infty}{" + f'{a}'+ "}$}")  if s1=='<=' else print("\\mauvaise{$\interval[open right]{x}{" + f'{a}'+ "}$}")} 	
\pyc{print("\\bonne{$\interval[open]{-\infty}{" + f'{a}'+ "}$}")  if s1=='<' else print("\\mauvaise{$\interval[open]{-\infty}{" + f'{a}'+ "}$}")} 
\pyc{print("\\bonne{$\interval[open]{" + f'{a}'+ "}{\infty}$}")  if s1=='>' else print("\\mauvaise{$\interval[open]{" + f'{a}'+ "}{\infty}$}")} 
\pyc{print("\\bonne{$\interval[open right]{" + f'{a}'+ "}{\infty}$}")  if s1=='>=' else print("\\mauvaise{$\interval[open right]{\infty}{" + f'{a}'+ "}$}")}    
\pyc{print("\\mauvaise{$\interval[open left]{" + f'{a}'+ "}{\infty}$}")}	
\end{reponseshoriz} 
\end{question} 
\def\AMCbeginQuestion#1#2{}\AMCquestionNumberfalse 
\begin{question}{ALG-INEQU-INTERVALLES.q01b}  \hfill \\
	% Question simple à réponse simple    
L'ensemble des nombres $x$ tels que $\pyc{print(sp.latex(f"{b} {s2} x {s3} {c}").replace("<=", "\leqslant").replace(">=","\geqslant").replace("\\mathtt",' ').replace("\\text",' '))}$  se note : 
 
\AMCBoxedAnswers
\begin{reponseshoriz}
\pyc{if (s2=='<=') and (s3=='<=') : print("\\bonne{$\interval[]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='<=') and (s3=='<=') : print("\\mauvaise{$\interval[ ]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='<=') and (s3=='<=') : print("\\mauvaise{$\interval[open]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='<=') and (s3=='<=') : print("\\mauvaise{$\interval[open left]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='<=') and (s3=='<=') : print("\\mauvaise{$\interval[open]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
%
%
\pyc{if (s2=='<') and (s3=='<=') : print("\\bonne{$\interval[open left]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='<') and (s3=='<=') : print("\\mauvaise{$\interval[open right]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='<') and (s3=='<=') : print("\\mauvaise{$\interval[open right]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='<') and (s3=='<=') : print("\\mauvaise{$\interval[open left]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='<') and (s3=='<=') : print("\\mauvaise{$\interval[]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
%
% 
\pyc{if (s2=='<=') and (s3=='<') : print("\\bonne{$\interval[open right]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='<=') and (s3=='<') : print("\\mauvaise{$\interval[open right]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='<=') and (s3=='<') : print("\\mauvaise{$\interval[open left]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='<=') and (s3=='<') : print("\\mauvaise{$\interval[open]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='<=') and (s3=='<') : print("\\mauvaise{$\interval[open left]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
%
% 
\pyc{if (s2=='<') and (s3=='<') : print("\\bonne{$\interval[open]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")}   
\pyc{if (s2=='<') and (s3=='<') : print("\\mauvaise{$\interval[open right]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")}  
\pyc{if (s2=='<') and (s3=='<') : print("\\mauvaise{$\interval[open left]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")}  
\pyc{if (s2=='<') and (s3=='<') : print("\\mauvaise{$\interval[]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")}  
\pyc{if (s2=='<') and (s3=='<') : print("\\mauvaise{$\interval[open]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")}   
%
% 
\pyc{if (s2=='>=') and (s3=='>=') : print("\\bonne{$\interval[]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")}  
\pyc{if (s2=='>=') and (s3=='>=') : print("\\mauvaise{$\interval[]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='>=') and (s3=='>=') : print("\\mauvaise{$\interval[open left]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>=') and (s3=='>=') : print("\\mauvaise{$\interval[open]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>=') and (s3=='>=') : print("\\mauvaise{$\interval[open right]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
%
%
\pyc{if (s2=='>') and (s3=='>=') : print("\\bonne{$\interval[open right]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>') and (s3=='>=') : print("\\mauvaise{$\interval[open left]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>') and (s3=='>=') : print("\\mauvaise{$\interval[open]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>') and (s3=='>=') : print("\\mauvaise{$\interval[]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>') and (s3=='>=') : print("\\mauvaise{$\interval[open right]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
%
%
\pyc{if (s2=='>=') and (s3=='>') : print("\\bonne{$\interval[open left]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>=') and (s3=='>') : print("\\mauvaise{$\interval[open right]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>=') and (s3=='>') : print("\\mauvaise{$\interval[open]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>=') and (s3=='>') : print("\\mauvaise{$\interval[open right]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='>=') and (s3=='>') : print("\\mauvaise{$\interval[]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
%
%
\pyc{if (s2=='>') and (s3=='>') : print("\\bonne{$\interval[open]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>') and (s3=='>') : print("\\mauvaise{$\interval[]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>') and (s3=='>') : print("\\mauvaise{$\interval[]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 
\pyc{if (s2=='>') and (s3=='>') : print("\\mauvaise{$\interval[open right]{" + f'{c}'+ "}{" + f'{b}'+ "}$}")} 
\pyc{if (s2=='>') and (s3=='>') : print("\\mauvaise{$\interval[open]{" + f'{b}'+ "}{" + f'{c}'+ "}$}")} 	
\end{reponseshoriz} 
\end{question}  
}


\element{ALG-INEQU-DEG1-SOL-VF}{  
\pyc{[x1,a1,b1,c1,d1]=random.choice([
	[2,9,-5,6,3],   
	])} 
\pyc{exprAG=f'{a1}*x+{b1}'} 
\pyc{exprAD=f'{c1}*x+{d1}'}
\pyc{s1=random.choice(['<','>','<=','>='])} 
\pyc{[x2,a2,b2,c2,d2]=random.choice([ 
	[-1,3,-1,2,-4],  
	])} 
\pyc{exprBG=f'{a2}*x+{b2}'} 
\pyc{exprBD=f'{c2}*x+{d2}'}
\pyc{s2=random.choice(['<','>','<=','>='])} 
\pyc{[x3,a3,b3,c3,d3]=random.choice([ 
	[-2,1,3,-5,2],  
	])} 
\pyc{exprCG=f'{a3}*x**2+{b3}*x+{c3}'} 
\pyc{exprCD=f'{d3}'}
\pyc{s3=random.choice(['<','>','<=','>='])} 
%\vspace{-2em}
\begin{question}{ALG-INEQU-DEG1-SOL-VF.q01a} \hfill \\
Indiquer si chaque affirmation est vraie ou fausse \hfill \\
% Question simple à réponse simple 
\noindent
\parbox{0.73\linewidth}{
\pyc{print("$"+str(x1)+"$")} est une solution de l'inéquation 
\pyc{print("$"+sp.latex(eval(exprAG+str(s1)+exprAD)).replace("\leq", "\leqslant").replace("\geq", "\geqslant") +"$")}, d'inconnue $x$ :\dotfill} 
\hfill    
\parbox{0.25\linewidth}{		 
\AMCBoxedAnswers
\begin{reponseshoriz}[o]
\pyc{print('\\bonne{Vrai} \\mauvaise{Faux}')  if eval(exprAG+str(s1)+exprAD).subs(x,x1) else print('\\mauvaise{Vrai} \\bonne{Faux}')} 		
\end{reponseshoriz} 
} 
\end{question}  
%\vspace{-2em}
\def\AMCbeginQuestion#1#2{}\AMCquestionNumberfalse 
\begin{question}{ALG-INEQU-DEG1-SOL-VF.q01b}  
\noindent
\parbox{0.73\linewidth}{
	\pyc{print("$"+str(x2)+"$")} est une solution de l'inéquation 
	\pyc{print("$"+sp.latex(eval(exprBG+str(s2)+exprBD)).replace("\leq", "\leqslant").replace("\geq", "\geqslant") +"$")}, d'inconnue $x$ :\dotfill} 
\hfill    
\parbox{0.25\linewidth}{		 
	\AMCBoxedAnswers
	\begin{reponseshoriz}[o]
		\pyc{print('\\bonne{Vrai} \\mauvaise{Faux}')  if eval(exprBG+str(s2)+exprBD).subs(x,x2) else print('\\mauvaise{Vrai} \\bonne{Faux}')} 		
	\end{reponseshoriz} 
} 
\end{question} 
%\vspace{-1em}
\def\AMCbeginQuestion#1#2{}\AMCquestionNumberfalse 
\begin{question}{ALG-INEQU-DEG1-SOL-VF.q01c}  
\noindent
\parbox{0.73\linewidth}{
	\pyc{print("$"+str(x3)+"$")} est une solution de l'inéquation 
	\pyc{print("$"+sp.latex(eval(exprCG+str(s3)+exprCD)).replace("\leq", "\leqslant").replace("\geq", "\geqslant") +"$")}, d'inconnue $x$ :\dotfill} 
\hfill    
\parbox{0.25\linewidth}{		 
\AMCBoxedAnswers
\begin{reponseshoriz}[o]
	\pyc{print('\\bonne{Vrai} \\mauvaise{Faux}')  if eval(exprCG+str(s3)+exprCD).subs(x,x3) else print('\\mauvaise{Vrai} \\bonne{Faux}')} 		
\end{reponseshoriz} 
} 
\end{question}  
}
	
 


%---------------------------------
%  
%--------------------------------- 