Skip to content
Snippets Groups Projects
Verified Commit e7d69c0f authored by orestis.malaspin's avatar orestis.malaspin
Browse files

added 2,3,4 reines

parent c2015358
No related branches found
No related tags found
No related merge requests found
Pipeline #14824 passed
......@@ -55,7 +55,7 @@ void tri_insertion(int size, int tab[size]) {
. . .
* Parcous de tous les éléments (ordre $N$); placer (ordre $N$).
* Parcours de tous les éléments (ordre $N$); placer (ordre $N$).
* Moyenne: $\mathcal{O}(N^2)$.
. . .
......@@ -315,7 +315,7 @@ int ppcm(int m, int n) {
- `ppcm(mult_n,mult_m) = mult_n`
si `mult_n = mult_m` (condition d’arrêt)
# Problème des 8-reines
# Problème des 8-reines
* Placer 8 reines d'un jeu d'échecs sur un échiquier de $8 \times 8$
* Sans que les reines ne puissent se menacer mutuellement.
......@@ -323,6 +323,7 @@ int ppcm(int m, int n) {
## Conséquence
* Deux reines ne partagent pas la même rangée, colonne, ou diagonale.
* Donc chaque solution a **une** reine **par colonne** ou **ligne**.
## Généralisation
......@@ -333,3 +334,26 @@ int ppcm(int m, int n) {
![Problème des 8-reines. Source:
[wikipedia](https://fr.wikipedia.org/wiki/Problème_des_huit_dames)](./figs/fig_recursivite_8_reines.png){width=40%}
# Problème des 2-reines
![Le problème des 2 reines n'a pas de solution.](figs/2reines.svg)
# Problème des 3-reines
![Le problème des 3 reines n'a pas de solution non plus.](figs/3reines.svg)
# Problème des 4-reines
![Le problème des 4 reines a une solution.](figs/4reines.svg)
# Problème des 4-reines, symétrie
![Le problème des 4 reines a une autre solution (symétrie
horizontale).](figs/4reines_sym.svg)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="95.24704mm"
height="95.24704mm"
viewBox="0 0 95.24704 95.24704"
version="1.1"
id="svg8"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="2reines.svg">
<defs
id="defs2">
<marker
inkscape:stockid="Arrow2Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow2Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path1126"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
inkscape:connector-curvature="0" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="371.08618"
inkscape:cy="90.967382"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1884"
inkscape:window-height="1052"
inkscape:window-x="36"
inkscape:window-y="0"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid815"
originx="-18.680396"
originy="-59.695988" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-18.680395,-142.05697)">
<g
id="g1101"
transform="translate(-31.537804,-47.306706)"
style="stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none">
<g
id="g916"
style="stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none">
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 50.468199,189.61368 h 47.37352"
id="path821"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 50.468199,236.9872 h 47.37352"
id="path821-3"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 50.468199,236.9872 V 189.61368"
id="path821-6-7"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 97.841719,236.9872 V 189.61368"
id="path821-6-7-3"
inkscape:connector-curvature="0" />
</g>
<g
id="g916-5"
transform="translate(47.37352)"
style="stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none">
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 50.468199,189.61368 h 47.37352"
id="path821-6"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 50.468199,236.9872 h 47.37352"
id="path821-3-2"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 50.468199,236.9872 V 189.61368"
id="path821-6-7-9"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 97.841719,236.9872 V 189.61368"
id="path821-6-7-3-1"
inkscape:connector-curvature="0" />
</g>
<g
id="g916-2"
transform="translate(0,47.37352)"
style="stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none">
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 50.468199,189.61368 h 47.37352"
id="path821-7"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 50.468199,236.9872 h 47.37352"
id="path821-3-0"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 50.468199,236.9872 V 189.61368"
id="path821-6-7-93"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 97.841719,236.9872 V 189.61368"
id="path821-6-7-3-6"
inkscape:connector-curvature="0" />
</g>
<g
id="g916-0"
transform="translate(47.37352,47.37352)"
style="stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none">
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 50.468199,189.61368 h 47.37352"
id="path821-62"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 50.468199,236.9872 h 47.37352"
id="path821-3-6"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 50.468199,236.9872 V 189.61368"
id="path821-6-7-1"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 97.841719,236.9872 V 189.61368"
id="path821-6-7-3-8"
inkscape:connector-curvature="0" />
</g>
<text
id="text975"
y="224.14017"
x="65.009895"
style="font-size:30.53443909px;line-height:1.25;font-family:'Accanthis ADF Std';-inkscape-font-specification:'Accanthis ADF Std';letter-spacing:0px;word-spacing:0px;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none"
xml:space="preserve"><tspan
style="stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none"
y="224.14017"
x="65.009895"
id="tspan973"
sodipodi:role="line">R</tspan></text>
</g>
<path
style="fill:#999999;stroke:none;stroke-width:1.88976383;stroke-miterlimit:4;stroke-dasharray:none"
d="m 252.28925,627.12968 v -88 h 88 88 v 88 88 h -88 -88 z"
id="path1411"
inkscape:connector-curvature="0"
transform="scale(0.26458333)" />
<path
style="fill:#999999;stroke:none;stroke-width:1.88976383;stroke-miterlimit:4;stroke-dasharray:none"
d="m 73.289246,806.12968 v -88 h 88.000004 88 v 88 88 h -88 -88.000004 z"
id="path1413"
inkscape:connector-curvature="0"
transform="scale(0.26458333)" />
<path
style="fill:#999999;stroke:none;stroke-width:1.88976383;stroke-miterlimit:4;stroke-dasharray:none"
d="m 252.28925,806.12968 v -88 h 88 88 v 88 88 h -88 -88 z"
id="path1415"
inkscape:connector-curvature="0"
transform="scale(0.26458333)" />
</g>
</svg>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment