B2 The sides of square $A B C D$ have a length of 6. $M$ is the midpoint of $A B, P$ lies on diagonal $A C$ such that $M P+P B$ is minimized.

Calculate the length of $A P$.

![](https://cdn.mathpix.com/cropped/2024_04_17_3181bece6cd13f041828g-2.jpg?height=299&width=303&top_left_y=313&top_left_x=1476)
B2 $\mathrm{N}$ is the midpoint of $\mathrm{AD}$. For any point $\mathrm{P}$ on $\mathrm{AC}$, the distance to $\mathrm{M}$ is equal to the distance to $\mathrm{N}$.

So $\mathrm{MP}+\mathrm{PB}=\mathrm{NP}+\mathrm{PB}$. $\mathrm{NP}+\mathrm{PB}$ is minimal if we simply take the intersection of $\mathrm{BN}$ and $\mathrm{AC}$ for $P$.

Triangle PNA is similar to triangle PBC, so $\mathrm{PA}: \mathrm{PC}=\mathrm{NA}: \mathrm{BC}=1: 2$. Therefore, $\mathrm{AP}$ is equal to $\mathrm{AC} / 3=2 \sqrt{2}$

![](https://cdn.mathpix.com/cropped/2024_04_17_6b845a2526b379866c18g-1.jpg?height=348&width=348&top_left_y=2302&top_left_x=1431)

Number the positions:

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 6 | 1 | 7 | 4 | 2 | 9 | 13 | 11 | 10 | 12 | 8 | 5 | 3 |

The card in position 1 goes to position 2, the card in position 2 goes to position 5, the card in position 3 goes to position 13, and so on. We check how many times we need to shuffle for card 1 to return to its original position: 1 to 2 to 5 to 12 to 10 to 9 to 6 to 1. So after seven shuffles, 1 is back in its place, and the same applies to the cards that initially were in positions 2, 5, 12, 10, 9, and 6. The card in position 3 is back in its place after three shuffles, as 3 to 13 to 7 to 3. The card in position 4 stays in its place. The remaining card is 8, and it is back in its place after two shuffles via 8 to 11 to 8. For some cards, we need 7 shuffles, for others 3, and for a few 2. To get everything back in place, we need to shuffle $7 * 3 * 2=42$ times.