« Approfondissements de lycée/Logique » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 1 316 :
 
==Puzzles logiques==
Puzzle est un mot que tout le monde comprend, il fait référence à quelquechose d'évident qu'il est nécessaire de résoudre. Voici une collection de puzzles logiques que nous pouvons résoudre en utilisant l'algèbre booléenne.
Puzzle is an all-encompassing word, it refers to anything trivial that requires solving. Here is a collection of logic puzzles that we can solve using Boolean algebra.
 
 
'''Exemple 1'''
 
Nous avons deux types de personnes -- les chevaliers et les valets. Un chevalier dit toujours la vérité et un valet ment toujours.
We have two type of people -- knights or knaves. A knight always tell the truth but the knaves always lie.
 
TwoDeux peoplepersonnes, Alex andet Barbara, aresont chattingen train de discuter. Alex saysdit :"WeNous sommes tous les aredeux bothdes knavesvalets"
 
Qui est qui ?
Who is who?
 
Nous pouvons probablement déduire qu'''Alex'' est un valet, mais l'approche algébrique pour déterminer l'identité d'''Alex'' est la suivante :
We can probably work out that ''Alex'' is a knave in our heads, but the algebraic approach to determine ''Alex'' 's identity is as follows:
:LetSoit ''A'' beVRAIE TRUE ifsi Alex isest aun knightchevalier
:LetSoit ''B'' beVRAIE TRUE ifsi Barbara isest aun knightchevalier
:ThereIl arey a ''twodeux'' situations, eithersoit :
::Alex isest aun knightchevalier andet whatce hequ'il saysdit isest TRUEVRAI, OROU
::heil isn'est NOTPAS aun knightchevalier andet whatce hequ'il saysdit itest FALSEFAUX.
:Si nous traduisons cela en symboles :
:There we have it, we only need to translate it into symbols:
:A(A'B') + A'[(A'B')'] = 1
Nous simplifions :
we simplify:
:(AA')B' + A'[A + B] = 1
:A'A + A'B = 1
:A'B = 1
ThereforePar conséquent ''A'' isest FALSEFAUX andet ''B'' isest TRUEVRAI. ThereforePar conséquent Alex isest aun knavevalet andet Barbara aun knightchevalier.
 
'''Exemple 2'''
 
ThereIl arey threea businessmen,trois convenientlyhommes d'affaire, namednommés '''A'''bnerlbert, '''B'''illernard andet '''C'''harleyharles, whoqui ordercommandent des martinis togetherensemble chaque everysemaine weekenden accordingsuivant toles therègles followingsuivantes rules:
 
#IfSi A orderscommande aun martini, so doesalors B le fait.
#EitherSoit B orou C alwayscommandent ordertoujours aun martini, butmais neverjamais atau themême same lunchrepas.
#EitherSoit A orou C alwayscommandent ordertoujours aun martini (orou bothles deux)
#IfSi C orderscommande aun martini, so doesalors A le fait.
 
#<math>A \Rightarrow B</math> orou <math>AB + A'B' = 1</math>
#<math>B'C + BC' = 1</math>
#<math>A + C = 1</math>
#<math>C \Rightarrow A</math> orou <math>CA + C'A' = 1</math>
 
En mettant tout cela dans une formule et en simplifiant :
Putting all these into one formula and simplifying:
 
<math>
Ligne 1 363 :
&=& (AB + A'B') (B'C + BC') (A + C) 1A \\
&=& (AB + A'B') (B'C + BC') (A + C) A \\
&&\mbox{NowMaintenant thatque wenous knowsavons thatcela }A = 1\mbox{ wenous canpouvons substitutesubstituer thatcela dans in:} \\
&=& (1B + 0B') (B'C + BC') (1 + C) 1 \\
&=& (B) (B'C + BC') \\
&&\mbox{NowMaintenant thatque wenous knowsavons thatcela }B = 1\mbox{ wenous canpouvons substitutesubstituer thatcela dans in:} \\
&=& (1) (0C + 1C') \\
&=& C' \\
&&\mbox{IfSi }1 = C'\mbox{ thenalors }C = 0 \\
&&ABC' = 1
\end{matrix}