SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
SIMULATION NUMÉRIQUE DU JEU DE CARTES
PRÉSIDENT, DE STRATÉGIES & EXPLOITATION
VALENTIN RÖSE - TIPE 2016
1
TIPE 2016 - RÖSE
PLAN
▸ Introduction
▸ I - Le jeu Président & sa modélisation en Python
▸ II - Implémentation des stratégies & étude statistique
▸ III - Difficultés techniques rencontrées & complexité temporelle
▸ Conclusion
2
Objectif: Vérifier l ́efficacité des stratégies en les soumettant à la
simulation numérique d’un nombre important de parties.
TIPE 2016 - RÖSE
I - LE JEU PRÉSIDENT ET SA MODÉLISATION EN PYTHON 1/2
▸ Principe du jeu: On joue avec un jeu classique de 54 cartes
que l’on répartit en nombre égal entre les joueurs.
Le but de chaque joueur est de se débarrasser de sa main.
▸ Règles:
- jouer 1 à 4 cartes identiques, d’une hauteur supérieure
ou égale au dernier groupe posé sur la table
- si la table est vierge, alors on pose ce que l’on veut
- la pose d’un groupe de cartes identiques à celui sur la
table par le joueur i oblige le joueur i+1 à passer son tour
- c’est le perdant de la partie j qui à la main à la partie j+1
3
TIPE 2016 - RÖSE
I - LE JEU PRÉSIDENT ET SA MODÉLISATION EN PYTHON 2/2
▸ Modélisation:
- 3,4,…,10,V,D,R,A,2,JOKER —> 3,4,…,10,11,12,13,14,15,16
- le Joker compte comme un 2
- avec ou sans échanges de cartes
- le joueur 0 débute
▸ Exemple:
Tour 1: J0 joue 3-3 / J1 joue 3-3 / J2 / J3 joue 2-2
Tour 2: J3 joue 4-4-4 / J0 joue 5-5-5 / J1 / J2 / J3 / J0
Tour 3: J0 joue 6 / J1 joue JOKER ……..
4
TIPE 2016 - RÖSE
II - IMPLÉMENTATION DES STRATÉGIES & ÉTUDE STATISTIQUE 1/2
▸ Etude statistique: 2 fonctions
- stats_brutes(nb_parties,mode_de_jeu) —> nb de victoires
- stats_points(nb_parties,mode_de_jeu) —> syst. de points
1er - 5pts, 2e - 4pts, 3e - 3pts, 4e - 2pts, 5e - 1pt, 6e - 0pt
Stratégie: joueur Identifiant
Naïf J_naïf
Aléatoire J_aléat
Favorisant les groupes J_fav_grp
Favorisant les groupes sans les casser J_fav_grp1
Facilitant le saut du joueur suivant J_Saute
Ultime (mixte des stratégies, hors aléat.) J_Ultime
5
TIPE 2016 - RÖSE
II - IMPLÉMENTATION DES STRATÉGIES & ÉTUDE STATISTIQUE 2/2
1) La stratégie du Joueur ultime
est la plus efficace
2) Tendance à l’équilibrage dans
les points
6
▸ Cdt° exp: 1000 parties, avec échange de cartes, 6 stratégies
TIPE 2016 - RÖSE
III - DIFFICULTÉS TECHNIQUES RENCONTRÉES & COMPLEXITÉ TEMPORELLE 1/3
▸ Organisation du code:
commande import de python
- initialisation, gestion, president_12, stratégies2, classement, statistiques
▸ Implémentation des stratégies:
liste de fonctions
7
TIPE 2016 - RÖSE
III - DIFFICULTÉS TECHNIQUES RENCONTRÉES & COMPLEXITÉ TEMPORELLE 2/3
8
TIPE 2016 - RÖSE
III - DIFFICULTÉS TECHNIQUES RENCONTRÉES & COMPLEXITÉ TEMPORELLE 3/3
▸ Complexité linéaire de stats_points vérifiée:
Cdt° exp: 4 j. ultime - 10 à 10000 parties - avec échanges de cartes
▸ La concaténation est définitivement à éviter:
Cdt° exp: stats_points - 4 j. ultime - 1000 parties - avec échanges
- avec concaténation
- avec liste.append()
9
TIPE 2016 - RÖSE
BILAN
▸ Modélisations: La traduction d’un raisonnement dans le
langage informatique n’est au départ pas simple et demande
de bien le décomposer.
▸ Etude statistique:
En terme de victoires, c’est la stratégie « ultime » qui est la plus
efficace. On valide ainsi le résultat issu de la « réalité ».
En considérant le système de points, pour un grand nombre de
parties, les stratégies tendent à être équivalentes (hors joueur
aléatoire)
▸ Organisation & Complexité: Il est important de concevoir ses
scripts dans l’esprit d’une complexité temporelle minimale et de
la manière la plus claire pour faciliter l’évolution du code.
10

Contenu connexe

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

TIPE 2016 - RÖSE Valentin - SIMULATION NUMÉRIQUE DU JEU DE CARTES PRÉSIDENT, DE STRATÉGIES & EXPLOITATION

  • 1. SIMULATION NUMÉRIQUE DU JEU DE CARTES PRÉSIDENT, DE STRATÉGIES & EXPLOITATION VALENTIN RÖSE - TIPE 2016 1
  • 2. TIPE 2016 - RÖSE PLAN ▸ Introduction ▸ I - Le jeu Président & sa modélisation en Python ▸ II - Implémentation des stratégies & étude statistique ▸ III - Difficultés techniques rencontrées & complexité temporelle ▸ Conclusion 2 Objectif: Vérifier l ́efficacité des stratégies en les soumettant à la simulation numérique d’un nombre important de parties.
  • 3. TIPE 2016 - RÖSE I - LE JEU PRÉSIDENT ET SA MODÉLISATION EN PYTHON 1/2 ▸ Principe du jeu: On joue avec un jeu classique de 54 cartes que l’on répartit en nombre égal entre les joueurs. Le but de chaque joueur est de se débarrasser de sa main. ▸ Règles: - jouer 1 à 4 cartes identiques, d’une hauteur supérieure ou égale au dernier groupe posé sur la table - si la table est vierge, alors on pose ce que l’on veut - la pose d’un groupe de cartes identiques à celui sur la table par le joueur i oblige le joueur i+1 à passer son tour - c’est le perdant de la partie j qui à la main à la partie j+1 3
  • 4. TIPE 2016 - RÖSE I - LE JEU PRÉSIDENT ET SA MODÉLISATION EN PYTHON 2/2 ▸ Modélisation: - 3,4,…,10,V,D,R,A,2,JOKER —> 3,4,…,10,11,12,13,14,15,16 - le Joker compte comme un 2 - avec ou sans échanges de cartes - le joueur 0 débute ▸ Exemple: Tour 1: J0 joue 3-3 / J1 joue 3-3 / J2 / J3 joue 2-2 Tour 2: J3 joue 4-4-4 / J0 joue 5-5-5 / J1 / J2 / J3 / J0 Tour 3: J0 joue 6 / J1 joue JOKER …….. 4
  • 5. TIPE 2016 - RÖSE II - IMPLÉMENTATION DES STRATÉGIES & ÉTUDE STATISTIQUE 1/2 ▸ Etude statistique: 2 fonctions - stats_brutes(nb_parties,mode_de_jeu) —> nb de victoires - stats_points(nb_parties,mode_de_jeu) —> syst. de points 1er - 5pts, 2e - 4pts, 3e - 3pts, 4e - 2pts, 5e - 1pt, 6e - 0pt Stratégie: joueur Identifiant Naïf J_naïf Aléatoire J_aléat Favorisant les groupes J_fav_grp Favorisant les groupes sans les casser J_fav_grp1 Facilitant le saut du joueur suivant J_Saute Ultime (mixte des stratégies, hors aléat.) J_Ultime 5
  • 6. TIPE 2016 - RÖSE II - IMPLÉMENTATION DES STRATÉGIES & ÉTUDE STATISTIQUE 2/2 1) La stratégie du Joueur ultime est la plus efficace 2) Tendance à l’équilibrage dans les points 6 ▸ Cdt° exp: 1000 parties, avec échange de cartes, 6 stratégies
  • 7. TIPE 2016 - RÖSE III - DIFFICULTÉS TECHNIQUES RENCONTRÉES & COMPLEXITÉ TEMPORELLE 1/3 ▸ Organisation du code: commande import de python - initialisation, gestion, president_12, stratégies2, classement, statistiques ▸ Implémentation des stratégies: liste de fonctions 7
  • 8. TIPE 2016 - RÖSE III - DIFFICULTÉS TECHNIQUES RENCONTRÉES & COMPLEXITÉ TEMPORELLE 2/3 8
  • 9. TIPE 2016 - RÖSE III - DIFFICULTÉS TECHNIQUES RENCONTRÉES & COMPLEXITÉ TEMPORELLE 3/3 ▸ Complexité linéaire de stats_points vérifiée: Cdt° exp: 4 j. ultime - 10 à 10000 parties - avec échanges de cartes ▸ La concaténation est définitivement à éviter: Cdt° exp: stats_points - 4 j. ultime - 1000 parties - avec échanges - avec concaténation - avec liste.append() 9
  • 10. TIPE 2016 - RÖSE BILAN ▸ Modélisations: La traduction d’un raisonnement dans le langage informatique n’est au départ pas simple et demande de bien le décomposer. ▸ Etude statistique: En terme de victoires, c’est la stratégie « ultime » qui est la plus efficace. On valide ainsi le résultat issu de la « réalité ». En considérant le système de points, pour un grand nombre de parties, les stratégies tendent à être équivalentes (hors joueur aléatoire) ▸ Organisation & Complexité: Il est important de concevoir ses scripts dans l’esprit d’une complexité temporelle minimale et de la manière la plus claire pour faciliter l’évolution du code. 10