Flocons de Bonheur

On le pourchasse, on se l'achète, on le cherche chez l'autre, dans son regard, dans ses gestes. On vogue de plaisirs en plaisirs sans vraiment le toucher. Mais qu'est-ce donc alors que le bonheur?

Bon, les tests préliminaires ne sont pas extraordinaires, mais je continue mon exploration. Mon objectif serait au final d’utiliser la capacité d’un modèle IA de comprendre une question formulée dans le langage courant, que ce soit en anglais ou en français et se baser sur une série de document que je lui fournirais pour retourner une réponse qui fait du sens.

LMStudio est OK pour poser les questions dans un chat, mais ça ne semble pas être le meilleur moyen pour atteindre mon objectif. En me basant sur cet article https://colinocallaghan.substack.com/p/install-and-run-deepseek-locally, j’ai donc installé Ollama de façon à interroger le modèle à partir de Python, un outil de programmation que je connais assez bien.

Donc, après avoir installé Ollama, après avoir téléchargé localement un modèle léger de Deepseek avec celui-ci et installé la librairie ollama, je fais donc ce premier test en Python:

import ollama

response = ollama.chat(
    model='deepseek-r1:1.5b',
    messages=[
        {'role': 'user', 'content': ' what is the probability of pulling 4 ace of spades from a deck of cards?'}
    ]
)

# Print the response
print(response['message']['content'])

En exécutant le script Python, le résultat préliminaire est le suivant:

To determine the probability of drawing exactly four aces of spades from a standard deck, I first need to calculate the total number of ways to choose any four cards from the deck. Since there are 52 cards in a deck, the total number of possible combinations is given by the combination formula C(52,4).

Next, I consider the specific case where all four chosen cards are the ace of spades. In a standard deck, there’s only one ace of spades, so this means there is exactly one way to choose all four aces of spades.

Finally, the probability is found by dividing the number of favorable outcomes (choosing the four aces of spades) by the total number of possible ways to select any four cards from the deck. This results in 1 divided by C(52,4), which simplifies to approximately 0.000076 or 0.0076%.

To determine the probability of pulling 4 aces of spades from a standard deck of cards, let’s follow these steps:

Step 1: Understand the Deck Composition
  • A standard deck has 52 cards:
  • 4 suits: hearts, diamonds, clubs, and spades.
  • 13 cards per suit: Ace through King.
  • There is only 1 ace of spades in the entire deck.
Step 2: Calculate Total Possible Ways to Choose 4 Cards

The total number of ways to choose any 4 cards from the 52-card deck is given by the combination formula:

[
C(n, k) = \frac{n!}{k!(n – k)!}
]

Where:

  • ( n = 52 )
  • ( k = 4 )

So,

[
C(52, 4) = \frac{52!}{4!(52 – 4)!} = \frac{52!}{4! \cdot 48!}
]

Calculating this:

[
C(52, 4) = \frac{52 \times 51 \times 50 \times 49}{4 \times 3 \times 2 \times 1} = 270,725
]

Step 3: Determine Favorable Outcomes

Since there is only 1 ace of spades in the deck, the number of ways to choose all four aces of spades is:

[
C(1, 4) = 1
]

Step 4: Calculate the Probability

The probability ( P ) of drawing exactly 4 aces of spades is the ratio of favorable outcomes to total possible combinations:

[
P = \frac{\text{Favorable Outcomes}}{\text{Total Possible Outcomes}} = \frac{1}{270,725}
]

Final Answer

[
\boxed{\dfrac{1}{270,!725}}
]

Wow, quand même assez impressionnant. Évidemment, le temps réponse (autour de 20 secondes) est assez long, mais sans carte graphique performante (GPU), c’est compréhensible. Je vais donc continuer mon exploration avec ce modèle.

Posted in ,

Laisser un commentaire