This is a personal interest project that aims to gain a better understanding of a common Rugby warmup drill called "infinite passing".
pip install pyyaml
Players will line up in lines (typically no more than 5 or 6) and pass the ball according to the following steps.
The ball starts on the leftmost line.
- the player with the ball passes to the adjacent right line
- the player who just passed the ball goes to the end of the adjacent right line
- repeat steps 1 and 2 until the ball reaches the rightmost line
- the player with the ball passes to the adjacent left line
- the player who just passed the ball goes to the end of the adjacent left line
- repeat steps 1-6
Below is a diagram of the drill running where the ball is passed 4 times. Each column is a line of players where each number is a unique player. A number with b
immediately after it represents the player with the ball. For example, 1b
means player 1 has the ball.
Note: If you are running the code in Drill.py
, the player with the ball will be colored yellow instead of having a b
after their number.
The example below was generated by the code in Drill.py
.
Initial State:
Line 1: Line 2: Line 3:
1b 2 3
4 5 6
7 8 9
Iteration 1:
Line 1: Line 2: Line 3:
4 2b 3
7 5 6
8 9
1
Iteration 2:
Line 1: Line 2: Line 3:
4 5 3b
7 8 6
1 9
2
Iteration 3:
Line 1: Line 2: Line 3:
4 5b 6
7 8 9
1 2
3
Iteration 4:
Line 1: Line 2: Line 3:
4b 8 6
7 1 9
5 3 2
A common occurence in this drill is that one or more players will oscillate between two lines. This is happens when a player goes to the line they were just in without going all the way down to the last line. For example, if a player, Jeff, is in a drill with 3 lines and is the first person in line 1, Jeff would have oscillated one time if he were to pass to (and subsequently join) line 2 and then pass back to (and join) line 1 again without having visited line 3.
A key characteristic that determines whether a player will oscillate or not is whether the line they are entering has an odd or even number of players excluding the one entering. If Jeff passes the ball and goes to the end of a line with an even number of players (excluding himself), his next turn would not result in an oscillation. Conversly, if Jeff were to enter a line with an odd number of players (excluding himself), his next turn would not result in an oscillation. The only exception is if the ball reaches the end and switches direction. Since that is a necessary part of the drill, changes in direction on the ends of the drill will not be counted as an oscillation. Below is a brief example where Jeff is player 1.
Jeff enters an odd line (example generated by the code in Drill.py
)
Initial State:
Line 1: Line 2: Line 3:
1b 2 3
4
Iteration 1:
Line 1: Line 2: Line 3:
4 2b 3
1
Iteration 2:
Line 1: Line 2: Line 3:
4 1 3b
2
Iteration 3:
Line 1: Line 2: Line 3:
4 1b 2
3
Iteration 4:
Line 1: Line 2: Line 3:
4b 3 2
1
Player 1 oscillated 1 times.
Player 2 did not oscillate.
Player 3 did not oscillate.
Player 4 did not oscillate.
Jeff enters an even line (example generated by the code in Drill.py
)
Initial State:
Line 1: Line 2: Line 3:
1b 2 3
4 5
Iteration 1:
Line 1: Line 2: Line 3:
4 2b 3
5
1
Iteration 2:
Line 1: Line 2: Line 3:
4 5 3b
1 2
Iteration 3:
Line 1: Line 2: Line 3:
4 5b 2
1
3
Iteration 4:
Line 1: Line 2: Line 3:
4b 1 2
5 3
Iteration 5:
Line 1: Line 2: Line 3:
5 1b 2
3
4
Iteration 6:
Line 1: Line 2: Line 3:
5 3 2b
4 1
Player 1 did not oscillate.
Player 2 did not oscillate.
Player 3 did not oscillate.
Player 4 did not oscillate.
Player 5 did not oscillate.
As you can see from the visualization above, Jeff (player 1) passes the ball a total of two times in each instance. When there was an even number of players in line 2, he did not oscillate. However, when there was an odd number of players in line 2, he did oscillate.
Let
Assume
- if
$n$ is even, then$n+1$ is odd which means that the player will oscillate by our inductive hypothesis. - if
$n$ is odd, then$n+1$ is even which means that our player will not oscillate by our inductive hypothesis.
Since
Run a single instance of a drill where every iteration is printed:
python3 Drill.py
To run a brute force over range of player and line counts for a number of iterations:
python3 brute_force_drills.py
Further details on modifying the parameters for both scripts can be found in the respective files.
To gain intuition on the problem and potentially observe patterns, I am starting with a brute force approach where I am keeping track of what combination of lines and players result in no oscillations for a given number of run iterations to look for any patterns that may exist.
Note: Given the above constriants on
For each drill with
- Let
$m = \min{X_j}$ ,
-
$\forall j > 1 \ \ \forall p \in [j+1, \infty)$ , it seems that
This makes sense because we know that if every line contains an even number of players, then no player will oscillate. With infinite players or lines, there are an infinite number of ways to achieve an even number of players in each line.
- If
$p$ is restricted to$p \le c \cdot j$ for some constant$c \mod 10 = 0$ , then
. This was observed for
- Propose an algorithm that will yield all possible values of
$p$ that result in a 0 oscillation drill for a given number of lines$j$ and a given maximum number of players$p_{\text{max}}$ .- One version should be able to handle
$i \rightarrow \infty$ - The second version should be able to handle any positive value of
$i$ .
- One version should be able to handle
Learn Coq: https://cel.hal.science/inria-00001173v6/document