La matematica nel gioco Dobble

All'ultima serata in famiglia, il gioco Dobble (nell'edizione Harry Potter) è stato portato in tavola con entusiasmo dai bambini. Dopo il 5° round perso (senza alcun risultato visibile della mia carta con la carta da gioco) mi è stato detto, con mio stupore, che ogni giocatore può sempre trovare un colpo in ogni round. Ma la mia incredulità è stata riconosciuta solo con ulteriori giri persi: i bambini erano semplicemente più veloci.


Motivo sufficiente per dare un'occhiata più da vicino al gioco da un punto di vista matematico. Innanzitutto il principio del gioco: Dobble è un semplice gioco di carte con \(55\) carte rotonde, ciascuna con otto simboli diversi. Tutte le carte vengono distribuite a turno, lasciando solo l'ultima carta al centro del tavolo. Ora tutti i giocatori devono confrontare simultaneamente i simboli sulla carta con i simboli sulla loro carta in cima corrente. Se un giocatore ha trovato lo stesso simbolo su entrambe le carte, può mettere la sua carta in pila essendo il più veloce a nominare il simbolo. Vince il giocatore che scarta per primo tutte le proprie carte.

Com'è possibile che ci siano \(55\) tali carte che sono state costruite in modo tale che 2 carte qualsiasi abbiano esattamente un simbolo in comune? Qual è il numero minimo di tali simboli che devono essere utilizzati? Qual è il numero massimo di tali carte?

Per prima cosa, costruiamo queste carte usando i seguenti passaggi logici (tutte le carte costruite successivamente hanno la proprietà di essere ordinate in ordine crescente): La prima carta deve avere 8 simboli diversi, cioè si legge:

$$\left(\begin{array}{c} 1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \\ 7 \\ 8 \end{array}\right)$$

Ora costruiamo le seguenti carte in modo tale che abbiano esattamente un simbolo in comune con la prima carta:

$$\left(\begin{array}{c} 1 \\ x_{1.2} \\ x_{1.3} \\ x_{1.4} \\ x_{1.5} \\ x_{1.6} \\ x_{1.7} \\ x_{1.8} \end{array}\right), \left(\begin{array}{c} 1 \\ x_{2.2} \\ x_{2.3} \\ x_{2.4} \\ x_{2.5} \\ x_{2.6} \\ x_{2.7} \\ x_{2.8} \end{array}\right), \left(\begin{array}{c} 1 \\ x_{3.2} \\ x_{3.3} \\ x_{3.4} \\ x_{3.5} \\ x_{3.6} \\ x_{3.7} \\ x_{3.8} \end{array}\right), \ldots, \left(\begin{array}{c} 1 \\ x_{k.2} \\ x_{k.3} \\ x_{k.4} \\ x_{k.5} \\ x_{k.6} \\ x_{k.7} \\ x_{k.8} \end{array}\right)$$

Qui è già possibile costruire un numero qualsiasi di tali carte (compila semplicemente i posti in ordine crescente, iniziando con \(9\) ). Questo caso banale non è tuttavia interessante, poiché a noi interessa un set con un numero minimo di simboli (e un numero massimo di carte). Consideriamo ora il secondo simbolo \( x_{l.2} \) di ciascuna carta, per il quale ovviamente deve valere quanto segue: \( x_{1.2} \neq x_{2.2} \neq x_{3.2} \neq \ldots \neq x_{k.2} \) . Abbiamo quindi necessariamente introdotto \( k \) nuovi simboli. Ma ora \( k \leq 8-1 = 7 \) , poiché nessuno dei \( 7 \) simboli \( x_{1.2},\, x_{1.3},\, x_{1.4},\, x_{1.5},\, x_{1.6},\, x_{1.7},\, x_{1.8} \) (della carta più a sinistra) può corrispondere al secondo simbolo di ciascuna delle altre carte (altrimenti ci sarebbero due simboli identici ).

Abbiamo trovato un massimo di queste 7 nuove carte:

$$\left(\begin{array}{c} 1 \\ x_{1.2} \\ x_{1.3} \\ x_{1.4} \\ x_{1.5} \\ x_{1.6} \\ x_{1.7} \\ x_{1.8} \end{array}\right), \left(\begin{array}{c} 1 \\ x_{2.2} \\ x_{2.3} \\ x_{2.4} \\ x_{2.5} \\ x_{2.6} \\ x_{2.7} \\ x_{2.8} \end{array}\right), \left(\begin{array}{c} 1 \\ x_{3.2} \\ x_{3.3} \\ x_{3.4} \\ x_{3.5} \\ x_{3.6} \\ x_{3.7} \\ x_{3.8} \end{array}\right), \left(\begin{array}{c} 1 \\ x_{4.2} \\ x_{4.3} \\ x_{4.4} \\ x_{4.5} \\ x_{4.6} \\ x_{4.7} \\ x_{4.8} \end{array}\right), \left(\begin{array}{c} 1 \\ x_{5.2} \\ x_{5.3} \\ x_{5.4} \\ x_{5.5} \\ x_{5.6} \\ x_{5.7} \\ x_{5.8} \end{array}\right), \left(\begin{array}{c} 1 \\ x_{6.2} \\ x_{6.3} \\ x_{6.4} \\ x_{6.5} \\ x_{6.6} \\ x_{6.7} \\ x_{6.8} \end{array}\right), \left(\begin{array}{c} 1 \\ x_{7.2} \\ x_{7.3} \\ x_{7.4} \\ x_{7.5} \\ x_{7.6} \\ x_{7.7} \\ x_{7.8} \end{array}\right)$$

Con lo stesso argomento ora costruiamo le prossime \(7\) mappe (la prima di queste mappe deve entrare in collisione con la nostra mappa di partenza, e non con \(1\) , altrimenti sarebbe con la \(7\) precedente mappe trovate):

$$\left(\begin{array}{c} 2 \\ x_{8.2} \\ x_{8.3} \\ x_{8.4} \\ x_{8.5} \\ x_{8.6} \\ x_{8.7} \\ x_{8.8} \end{array}\right), \left(\begin{array}{c} 2 \\ x_{9.2} \\ x_{9.3} \\ x_{9.4} \\ x_{9.5} \\ x_{9.6} \\ x_{9.7} \\ x_{9.8} \end{array}\right), \left(\begin{array}{c} 2 \\ x_{10.2} \\ x_{10.3} \\ x_{10.4} \\ x_{10.5} \\ x_{10.6} \\ x_{10.7} \\ x_{10.8} \end{array}\right), \left(\begin{array}{c} 2 \\ x_{11.2} \\ x_{11.3} \\ x_{11.4} \\ x_{11.5} \\ x_{11.6} \\ x_{11.7} \\ x_{11.8} \end{array}\right), \left(\begin{array}{c} 2 \\ x_{12.2} \\ x_{12.3} \\ x_{12.4} \\ x_{12.5} \\ x_{12.6} \\ x_{12.7} \\ x_{12.8} \end{array}\right), \left(\begin{array}{c} 2 \\ x_{13.2} \\ x_{13.3} \\ x_{13.4} \\ x_{13.5} \\ x_{13.6} \\ x_{13.7} \\ x_{13.8} \end{array}\right), \left(\begin{array}{c} 2 \\ x_{14.2} \\ x_{14.3} \\ x_{14.4} \\ x_{14.5} \\ x_{14.6} \\ x_{14.7} \\ x_{14.8} \end{array}\right)$$

Questo argomento può essere continuato anche per le prossime carte \(7\) ; Un totale \(8-2 = 6\) volte. Le ultime \(7\) carte sono di conseguenza:

$$\left(\begin{array}{c} 8 \\ x_{50.2} \\ x_{50.3} \\ x_{50.4} \\ x_{50.5} \\ x_{50.6} \\ x_{50.7} \\ x_{50.8} \end{array}\right), \left(\begin{array}{c} 8 \\ x_{51.2} \\ x_{51.3} \\ x_{51.4} \\ x_{51.5} \\ x_{51.6} \\ x_{51.7} \\ x_{51.8} \end{array}\right), \left(\begin{array}{c} 8 \\ x_{52.2} \\ x_{52.3} \\ x_{52.4} \\ x_{52.5} \\ x_{52.6} \\ x_{52.7} \\ x_{52.8} \end{array}\right), \left(\begin{array}{c} 8 \\ x_{53.2} \\ x_{53.3} \\ x_{53.4} \\ x_{53.5} \\ x_{53.6} \\ x_{53.7} \\ x_{53.8} \end{array}\right), \left(\begin{array}{c} 8 \\ x_{54.2} \\ x_{54.3} \\ x_{54.4} \\ x_{54.5} \\ x_{54.6} \\ x_{54.7} \\ x_{54.8} \end{array}\right), \left(\begin{array}{c} 8 \\ x_{55.2} \\ x_{55.3} \\ x_{55.4} \\ x_{55.5} \\ x_{55.6} \\ x_{55.7} \\ x_{55.8} \end{array}\right), \left(\begin{array}{c} 8 \\ x_{56.2} \\ x_{56.3} \\ x_{56.4} \\ x_{56.5} \\ x_{56.6} \\ x_{56.7} \\ x_{56.8} \end{array}\right)$$

Se dovessi aggiungere un'altra carta $$\left(\begin{array}{c} 9 \\ x_{57.2} \\ x_{57.3} \\ x_{57.4} \\ x_{57.5} \\ x_{57.6} \\ x_{57.7} \\ x_{57.8} \end{array}\right)$$ fallirà perché questa carta non condivide un simbolo con la carta iniziale. Abbiamo costruito un massimo di mappe \(1 + 8 \cdot 7 = 57\) . Il nostro obiettivo ora è costruirne almeno altrettanti.

Per fare ciò, esaminiamo le prime 7 nuove carte trovate e giungiamo alla conclusione che abbiamo assolutamente bisogno di \(7 \cdot 7\) nuovi simboli qui (nessuna carta può avere un simbolo due volte e ogni simbolo da assegnare non deve apparire due volte, dal momento che \(1\) è già doppio):

$$\left(\begin{array}{c} 1 \\ 9 \\ 10 \\ 11 \\ 12 \\ 13 \\ 14 \\ 15 \end{array}\right), \left(\begin{array}{c} 1 \\ 16 \\ 17 \\ 18 \\ 19 \\ 20 \\ 21 \\ 22 \end{array}\right), \left(\begin{array}{c} 1 \\ 23 \\ 24 \\ 25 \\ 26 \\ 27 \\ 28 \\ 29 \end{array}\right), \left(\begin{array}{c} 1 \\ 30 \\ 31 \\ 32 \\ 33 \\ 34 \\ 35 \\ 36 \end{array}\right), \left(\begin{array}{c} 1 \\ 37 \\ 38 \\ 39 \\ 40 \\ 41 \\ 42 \\ 43 \end{array}\right), \left(\begin{array}{c} 1 \\ 44 \\ 45 \\ 46 \\ 47 \\ 48 \\ 49 \\ 50 \end{array}\right), \left(\begin{array}{c} 1 \\ 51 \\ 52 \\ 53 \\ 54 \\ 55 \\ 56 \\ 57 \end{array}\right)$$

Quindi abbiamo bisogno di simboli \(8 + (7 \cdot 7) = 57\) minimi (tanti simboli quante carte!). Ora stiamo cercando di cavarcela con questo numero e di trovare una regola di costruzione per tutti gli altri elementi. Per fare ciò, costruiamo un dobble leggermente più piccolo che ha solo \(3\) simboli per carta e lo riceviamo come carta iniziale

$$\left(\begin{array}{c} 1 \\ 2 \\ 3 \end{array}\right)$$

e le altre carte

$$\left(\begin{array}{c} 1 \\ 4 \\ 5 \end{array}\right), \left(\begin{array}{c} 1 \\ 6 \\ 7 \end{array}\right)$$

$$\left(\begin{array}{c} 2 \\ x_{3.2} \\ x_{3.3} \end{array}\right), \left(\begin{array}{c} 2 \\ x_{4.2} \\ x_{4.3} \end{array}\right)$$

$$\left(\begin{array}{c} 3 \\ x_{5.2} \\ x_{5.3} \end{array}\right), \left(\begin{array}{c} 3 \\ x_{6.2} \\ x_{6.3} \end{array}\right)$$

con un totale di \(1 + 3 \cdot 2 = 7\) carte e \( 3 + (2 \cdot 2) = 7\) simboli. Con un po' di tentativi ed errori (e usando i simboli già assegnati) si ottiene il seguente dobble:

$$\left(\begin{array}{c} 1 \\ 2 \\ 3 \end{array}\right)$$

$$\left(\begin{array}{c} 1 \\ 4 \\ 5 \end{array}\right), \left(\begin{array}{c} 1 \\ 6 \\ 7 \end{array}\right)$$

$$\left(\begin{array}{c} 2 \\ 4 \\ 6 \end{array}\right), \left(\begin{array}{c} 2 \\ 5 \\ 7 \end{array}\right)$$

$$\left(\begin{array}{c} 3 \\ 4 \\ 7 \end{array}\right), \left(\begin{array}{c} 3 \\ 5 \\ 6 \end{array}\right)$$

Si può trovare anche questo sistematicamente? Per fare ciò, inseriamo i simboli appena assegnati \(4, 5, 6, 7\) in una matrice quadrata:

$$\begin{array}{ccc} 4 & & 5 \\ & & \\ 6 & & 7\end{array}$$

Ora immaginiamo per le prime due carte (a partire dai simboli iniziali \ \(4\) e \(5\) ) linee di collegamento verticali ai simboli inferiori \(6\) e \(7\):

$$\begin{array}{ccc} 4 & & 5 \\ \vdots & & \vdots \\ 6 & & 7\end{array}$$

Poiché queste linee non si intersecano, otteniamo (tracciando i simboli sulle linee di collegamento riga per riga) le carte valide più vicine:

$$\left(\begin{array}{c} 2 \\ 4 \\ 6 \end{array}\right), \left(\begin{array}{c} 2 \\ 5 \\ 7 \end{array}\right)$$

Infine, immaginiamo di collegare linee con una pendenza diversa (in questo caso con la pendenza \(1\) ):

$$\begin{array}{ccccc} & 4 & & 5 & \\ \ddots & & \ddots & & \ddots \\ & 6 & & 7 &\end{array}$$

La seconda linea di collegamento (tra \(5\) e \(6\) ) lascia la matrice sul bordo destro e rientra sul bordo sinistro. Scegliendo sapientemente la pendenza, ci assicuriamo da un lato che le linee di collegamento non si intersechino tra loro, ma anche che le precedenti linee di collegamento (verticali) non si intersechino. Questa idea progettuale alla fine porta alla seguente formula di progettazione:

Un dobble con \(k \in \mathbb{N} \, | \, (k-1) \text{ prim} \) ha \(1+(k \cdot (k-1)) = k^2-k+1 = k + (k-1)(k-1)\) carte e simboli. Per la mappa \(K_x\) con \(x \in \mathbb{N}\) e \(0 \leq x \leq (k-1) \cdot k\):

$$K_x = \left(\begin{array}{c} f(x,1) \\ f(x,2) \\ \vdots \\ f(x,k) \end{array}\right), \,\, m = \left\lfloor \frac{x-1}{k-1} \right\rfloor + 1,$$

$$f(x,y) = \left\{\begin{array}{ll} y & \text{falls } x = 0 \\ \lfloor \frac{x-1}{k-1} \rfloor + 1, &\text{sonst falls } y = 1 \\ (k+1) + (k-1)(x-1) + (y-2), & \text{sonst falls } 0 < x < k \\ \left( \left((m-1)(k-1)+x\right)-1+ \left( (m-2)(y-2) \right) \right) \% (k-1) &\text{sonst} \\ + (k+1) + (k-1)(y-2)&\end{array}\right.$$

Ci sono \((k-1)\cdot k + 1 = k + (k-1)(k-1)\) pezzi di queste carte. Ora resta solo da mostrare:

$$ \forall x_1 < x_2 \in \{ 1, \ldots, k+(k-1)(k-1) \} \, \exists \, ! \, y_1, y_2 \in \{ 1, \ldots, k \}: f(x_1, y_1) = f(x_2, y_2) $$

  • 1 ° caso: \( x_1 = 0 \)
    • Caso 1a: \( 0 < x_2 < k \)
      • Per \(y_1 = 1\) e \(y_2 = 1\) :
        \(f(x_1, y_1) = f(0, 1) = 1\)
        \(f(x_2, y_2) = f(x_2, 1) = \lfloor \frac{x_2-1}{k-1} \rfloor + 1 = 1\) .
      • Per \(y_1 \neq 1\) e \(y_2 = 1\) :
        \(f(x_1, y_1) = f(0, y_1) = y_1 \neq 1\)
        \(f(x_2, y_2) = f(x_2, y_2) = \lfloor \frac{x_2-1}{k-1} \rfloor + 1 = 1\)
      • Per \(y_1 = 1\) e \(y_2 \neq 1\) :
        \(f(x_1, y_1) = f(0, 1) = 1\)
        \(f(x_2, y_2) = f(x_2, y_2) = (k+1) + (k-1)(x-1) + (y-2) =\)
        \((k+1)(x-1) + (k-1) + y \geq (k+1)(x-1)+y > 1\)
      • Per \(y_1 \neq 1\) e \(y_2 \neq 1\) è:
        \(f(x_1, y_1) = f(0, y_1) = y_1 \leq k\)
        \(f(x_2, y_2) = f(x_2, y_2) = (k+1) + (k-1)(x-1) + (y-2) > k\)
    • Caso 1b: \( x_2 \geq k \)
      • Per \(y_1 = \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1\) e \(y_2 = 1\) abbiamo:
        \(f(x_1, y_1) = f(0, \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1) = \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1\)
        \(f(x_2, y_2) = f(x_2, 1) = \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1\)
      • Per \(y_1 \neq \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1\) e \(y_2 = 1\) è:
        \(f(x_1, y_1) = f(0, y_1) = y_1 \neq \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1\)
        \(f(x_2, y_2) = f(x_2, 1) = \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1\)
      • Per \(y_2 \neq 1\) è:
        \(f(x_1, y_1) = f(0, y_1) = y_1 \leq k\)
        \(f(x_2, y_2) = \left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \% (k-1)\)
        \(+ (k+1) + (k-1)(y_2-2) \geq (k+1)+(k-1)(y_2-2) > k \)
  • 2 ° caso: \( 0 < x_1 < k \)
    • Caso 2a: \( 0 < x_2 < k \)
      • Per \(y_1 = 1\) e \(y_2 = 1\) :
        \(f(x_1, y_1) = f(x_1, 1) = \left\lfloor \frac{x_1-1}{k-1} \right\rfloor + 1 = 1\)
        \(f(x_2, y_2) = f(x_2, 1) = \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1 = 1\)
      • Per \(y_1 \neq 1\) e \(y_2 = 1\) :
        \(f(x_1, y_1) = f(x_1, y_1) = (k+1)+(k-1)(x_1-1)+(y_1-2) > 1\)
        \(f(x_2, y_2) = f(x_2, 1) = \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1 = 1\)
      • Per \(y_1 = 1\) e \(y_2 \neq 1\) :
        \(f(x_1, y_1) = f(x_1, 1) = \left\lfloor \frac{x_1-1}{k-1} \right\rfloor + 1 = 1\)
        \(f(x_2, y_2) = f(x_2, y_2) = (k+1)+(k-1)(x_2-1)+(y_2-2) > 1\)
      • Per \(y_1 \neq 1\) e \(y_2 \neq 1\) è:
        \(f(x_1, y_1) = (k+1)+(k-1)(x_1-1)+(y_1-2) \leq\)
        \((k+1)+(k-1)(x_1-1)+(k-2)\)
        \(f(x_2, y_2) = (k+1)+(k-1)(x_2-1)+(y_2-2) \geq\)
        \((k+1)+(k-1)((x_1+1)-1)+(y_2-2) =\)
        \((k+1)+(k-1)(x_1-1) + (k-1) + (y_2-2) \geq\)
        \((k+1)+(k-1)(x_1-1) + (k-1) + (2-2) \geq\)
        \((k+1)+(k-1)(x_1-1) + (k-1) > (k+1)+(k-1)(x_1-1) + (k-2)\)
    • Caso 2b: \( x_2 \geq k \)
      • Per \(y_1 = 1\) e \(y_2 = 1\) :
        \(f(x_1, y_1) = f(x_1, 1) = \left\lfloor \frac{x_1-1}{k-1} \right\rfloor + 1 = 1\)
        \(f(x_2, y_2) = f(x_2, 1) = \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1 \geq \left\lfloor \frac{k-1}{k-1} \right\rfloor + 1 = 2 > 1\)
      • Per \(y_1 = 1\) e \(y_2 \neq 1\) :
        \(f(x_1, y_1) = f(x_1, 1) = \left\lfloor \frac{x_1-1}{k-1} \right\rfloor + 1 = 1\)
        \(f(x_2, y_2) = \left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \% (k-1)\)
        \(+ (k+1) + (k-1)(y_2-2) \geq (k+1) + (k-1)(y_2-2) > 1\)
      • Per \(y_1 \neq 1\) e \(y_2 = 1\) :
        \(f(x_1, y_1) = \left( \left((m_1-1)(k-1)+x_1\right)-1+ \left( (m_1-2)(y_1-2) \right) \right) \% (k-1)\)
        \(+ (k+1) + (k-1)(y_1-2) \geq (k+1) + (k-1)(y_1-2) > 1\)
        \(f(x_2, y_2) = f(x_2, 1) = \left\lfloor \frac{x_2-1}{k-1} \right\rfloor + 1 = 1\)
      • Per \(y_1 \neq 1\) e \(y_2 \neq 1\) è:
        \((k+1) + (k-1)(x_1-1) + (y_1-2) =\)
        \(\left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \% (k-1)\)
        \(+ (k+1) + (k-1)(y-2)\)
        \(\Leftrightarrow y_1 = (k-1)y_2 - (k-1)(x_1+1) +\)
        \(\left( 2 + \left( \left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \% (k-1) \right) \right) \)
        Per \(y_2 = x_1+1\) insieme a \( 2 \leq y_2 \leq k\) è
        \(y_1 = 2 + \left( \left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \% (k-1) \right)\) insieme a \( 2 \leq y_1 \leq k\).
        C'è solo una soluzione qui \( (y_1, y_2) \).
        Perché scegliamo \(y^*_2=y_2-1\) come valore, è \(y^*_1 = y_1-(k-1) < 2\).
        Inoltre, per \(y^*_2*=y_2+1\) poi \(y^*_1 = y_1+(k-1) > k\).
  • 3. Caso: \( x_1 \geq k \)
    • Caso 3a: \( x_2 \geq k \)
      • Caso 3a': \(m_1 = \left\lfloor \frac{x_1-1}{k-1} \right\rfloor +1 = \left\lfloor \frac{x_2-1}{k-1} \right\rfloor +1 = m_2\)
        • Per \(y_1 = 1\) e \(y_2 = 1\) :
          \(f(x_1, y_1) = f(x_1, 1) = m_1\)
          \(f(x_2, y_2) = f(x_2, 1) = m_2 = m_1\)
        • Per \(y_1 = 1\) e \(y_2 \neq 1\) :
          \(f(x_1, y_1) = f(x_1, 1) = m_1 = \left\lfloor \frac{x_1-1}{k-1} \right\rfloor + 1 \leq \left\lfloor \frac{((k-1) \cdot k)-1}{k-1} \right\rfloor + 1 =\)
          \(\left\lfloor k - \frac{1}{k-1} \right\rfloor + 1 = (k - 1) + 1 = k\)
          \(f(x_2, y_2) = \left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \%\)
          \((k-1) + (k+1) + (k-1)(y_2-2) \geq\)
          \((k+1) + (k-1)(y_2-2) \geq (k+1) > k\)
        • Per \(y_1 \neq 1\) e \(y_2 = 1\) :
          Vedi \(y_1 = 1\) e \(y_2 \neq 1\) .
        • Per \(y_1 \neq 1\) e \(y_2 \neq 1\) è:
          \(f(x_1, y_1) = \left( \left((m_1-1)(k-1)+x_1\right)-1+ \left( (m_1-2)(y_1-2) \right) \right) \%\)
          \((k-1) + (k+1) + (k-1)(y_1-2) = L_1 + (k+1) + (k-1)(y_1-2)\)
          \(f(x_2, y_2) = \left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \%\)
          \((k-1) + (k+1) + (k-1)(y_2-2) = L_2 + (k+1) + (k-1)(y_2-2)\)
          Poi \(f(x_1, y_1) = f(x_2, y_2) \Leftrightarrow\)
          \(L_1 + (k+1) + (k-1)(y_1-2) = L_2 + (k+1) + (k-1)(y_2-2) \Leftrightarrow\)
          \(L_1 + (k-1)(y_1-2) = L_2 + (k-1)(y_2-2) \Leftrightarrow\)
          \(L_1 - L_2 = (k-1)(y_2-y_1)\)
          Per \(y_1 \neq y_2\) è \(L_1-L_2 \leq (k-2 - 0) = k-2 < (k-1)(y_2-y_1)\).
          Per \(y_1 = y_2\) è \(L_1 - L_2 = 0 \Leftrightarrow L_1 = L_2\) e
          \(\left( \left((m_1-1)(k-1)+x_1\right)-1+ \left( (m_1-2)(y_1-2) \right) \right) \% (k-1) =\)
          \(\left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \% (k-1) \Leftrightarrow\)
          \(x_1 = x_2 + (k-1)\cdot l\) in contraddizione con \(m_1 = m_2\).
      • Caso 3a'': \(m_1 = \left\lfloor \frac{x_1-1}{k-1} \right\rfloor +1 \neq \left\lfloor \frac{x_2-1}{k-1} \right\rfloor +1 = m_2\)
        • Per \(y_1 = 1\) e \(y_2 = 1\) :
          \(f(x_1, y_1) = f(x_1, 1) = m_1\)
          \(f(x_2, y_2) = f(x_2, 1) = m_2 \neq m_1\)
        • Per \(y_1 = 1\) e \(y_2 \neq 1\) :
          \(f(x_1, y_1) = f(x_1, 1) = m_1 = \left\lfloor \frac{x_1-1}{k-1} \right\rfloor + 1 \leq \left\lfloor \frac{((k-1) \cdot k)-1}{k-1} \right\rfloor + 1 =\)
          \(\left\lfloor k - \frac{1}{k-1} \right\rfloor + 1 = (k - 1) + 1 = k\)
          \(f(x_2, y_2) = \left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \%\)
          \((k-1) + (k+1) + (k-1)(y_2-2) \geq\)
          \((k+1) + (k-1)(y_2-2) \geq (k+1) > k\)
        • Per \(y_1 \neq 1\) e \(y_2 = 1\) :
          Vedi \(y_1 = 1\) e \(y_2 \neq 1\) .
        • Per \(y_1 \neq 1\) e \(y_2 \neq 1\) è:
          \(f(x_1, y_1) = \left( \left((m_1-1)(k-1)+x_1\right)-1+ \left( (m_1-2)(y_1-2) \right) \right) \%\)
          \((k-1) + (k+1) + (k-1)(y_1-2) = L_1 + (k+1) + (k-1)(y_1-2)\)
          \(f(x_2, y_2) = \left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \%\)
          \((k-1) + (k+1) + (k-1)(y_2-2) = L_2 + (k+1) + (k-1)(y_2-2)\)
          Poi \(f(x_1, y_1) = f(x_2, y_2) \Leftrightarrow\)
          \(L_1 + (k+1) + (k-1)(y_1-2) = L_2 + (k+1) + (k-1)(y_2-2) \Leftrightarrow\)
          \(L_1 + (k-1)(y_1-2) = L_2 + (k-1)(y_2-2) \Leftrightarrow\)
          \(L_1 - L_2 = (k-1)(y_2-y_1)\)
          Per \(y_1 \neq y_2\) è \(L_1-L_2 \leq (k-2 - 0) = k-2 < (k-1)(y_2-y_1)\).
          Per \(y_1 = y_2\) è \(L_1 - L_2 = 0 \Leftrightarrow L_1 = L_2\) e
          \(\left( \left((m_1-1)(k-1)+x_1\right)-1+ \left( (m_1-2)(y_1-2) \right) \right) \% (k-1) =\)
          \(\left( \left((m_2-1)(k-1)+x_2\right)-1+ \left( (m_2-2)(y_2-2) \right) \right) \% (k-1) \Leftrightarrow\)
          \(y = \frac{(k-1)\cdot l + (3-k)(m_2 - m_1) + (x_1 - x_2)}{m_2 - m_1}\)
          Bene lì per \(2 \leq y \leq k\) sempre un \(l \in \mathbb{N}_0\), affinché
          \(m_2 - m_1 \mid (k-1)\cdot l + (3-k)(m_2 - m_1) + (x_1 - x_2)\).
          Prova: lì \((k-1)\) è primo, è (a causa del lemma di Bézout)
          \((k-1)\cdot l \equiv -\left( (3-k)(m_2-m_1) + (x_1-x_2) \right) \, \mod (m_2-m_1)\)
          risolvibile, perché \(\text{ggT}\left((k-1),(m_2-m_1)\right) = 1\) Si divide \(-\left( (3-k)(m_2-m_1) + (x_1-x_2) \right)\).
          Allora questa è l'unica soluzione \(l_1\), perché per uno
          \(l_2 = l_1 + (m_2-m_1)\) è \( y_2 = y_1 + (k-1) > k\).

Puoi anche trovare informazioni di base interessanti sul tema del dobble e della matematica qui o qui . Nello script seguente puoi vedere in azione la formula precedentemente provata: Dobbles (for \((k-1)\) prim) può essere generato con la semplice pressione di un pulsante:

See the Pen DOBBLE CREATOR by David Vielhuber (@vielhuber) on CodePen.

Indietro