Task 2: Boggle Buddy The game of Boggle is normally played on a 4x4 grid. 16 dice, each…
- User
Task 2: Boggle Buddy
The game of Boggle is normally played on a 4x4 grid. 16 dice, each die printed with six characters from the letters A to Z, are placed in a closed container and the container is shaken. The dice land in the 4x4 grid and the letter on the top face is the letter for that grid square. A three-minute timer is typically started and players try and make as many words from the letters on the grid as they can before time runs out. These words have to follow certain rules - for this task we will assume the rules followed are:
Each letter (except for the first letter) must be adjacent (horizontally, vertically or diagonally) to its preceding letter. A grid square's letter can only be used once (if there are two copies of the same letter appearing in different grid squares - both can be used). The word must be one of the allowed words.Though there are additional rules when played as a group of players, but points are assigned for the total number of letters in all valid words made. Part C (Written)
The parents notice the program often takes time to think of solutions, but only on boggle games where the same letter appears lots of times. Given the sand timer for thinking of words gives such a short time, they ask if there's a way to speed it up, for example, if each letter can only be used once in each word (even if it appears more than once on the board). How might their rule modification change the worst case complexity of finding all words?
NOTE** YOU MUST WRITE YOUR ANSWER IN OVERLEAF NOTAITON IN LATEX TYPESCRIPT SUCH THAT IS COMPATIBLE WITH THE ONLINE TYPESCRITER OVERLEAF
- Assistant
\documentclass{article} \usepackage{amsmath} \begin{document} \textbf{Impact of Rule Modification on Worst-Case Complexity} Imposing a restriction that each distinct letter can be used only once per word alters the search space for valid words in the Boggle game. \begin{itemize} \item \textbf{Original Rules:} Under the standard Boggle rules, each grid square's letter can be used once per word, but if a letter appears multiple times on the grid, each occurrence can be utilized separately. This leads to a branching factor of up to 8 (since each letter can connect to up to 8 neighboring letters). Consequently, the worst-case time complexity for finding all words of length $L$ is proportional to $\mathcal{O}(8^L)$. \item \textbf{Modified Rules:} With the modification that each distinct letter can be used only once per word, even if it appears multiple times on the grid, the branching factor is effectively reduced. This is because once a letter is used in a path, all its other occurrences are excluded from further exploration in that word. If there are $k$ unique letters on the grid, the branching factor decreases, potentially to a maximum of $7$ or lower, depending on the distribution of unique letters. Therefore, the worst-case time complexity becomes $\mathcal{O}(k \cdot 7^{L-1})$, assuming the first letter has $k$ choices and each subsequent letter has up to $7$ options. \end{itemize} \textbf{Conclusion:} While the worst-case time complexity remains exponential with respect to the word length $L$, the base of the exponent is reduced due to the decreased branching factor. This results in improved performance, especially in scenarios where the grid contains many duplicate letters. \end{document}