• Subject Code : COSC1285
• University :
• Subject Name : IT Computer Science

## Algorithms and Analysis

Contents

Two Words Hangman Solver

Description of Approach.

Rationale behind using this approach.

The Wheel of Fortune.

Description of Approach.

Rationale behind using this approach.

References.

### Two Words Hangman Solver

#### Description of Approach

1. Get the length for the words.
2. Filter all the words having lengths equal to the lengths of given words to guess. And store them in different sets Word1 and Word2 corresponding to their lengths.
3. We have made two separate sets for both the words.
4. Now randomly guess the first word, until we got a hit.
5. If a hit occurs, note the char and location of hit and note that weather it was word 1 or word 2.
6. Now filter Word1 and Word2 collection using the data from the hit guess response.
7. Keep on filtering (DataGenetics, 2020)and guessing, until we run out of moves or we guess both the words.

The distribution for the words of dictionary has been calculated but in case of playing hangman game the user knows the length of the words he is going to guess which allows the developer to refine the search further. The table shown below shows the popularity of the words in dictionary and their groups. In the table, the most popular words are on the top and least popular words on the lower side. The length of the words increases from going left to right. (DataGenetics, 2020)

#### Rationale Behind Using This Approach

A dictionary of words was available, so instead of guessing alphabets randomly, it is a lot better to use we can use some word eliminations depending on hit response of character. (Roald, 2020)
In order to generalize the two word case i created a new dictionary which is equal to the Cartesian product of current dictionary, etc. the concept of reduction is defined before defining the algorithm for it. In order to guess all the numbers L1, L2, L3 and so on it is important to reduce the size of dictionary in which few smaller words are reduced and few additional letters may also be eliminated.(Roald, 2020)

### The Wheel of Fortune

#### Description of Approach

1. Get the length for the all the words.
2. Filter all the words having lengths equal to the lengths of given words to guess. And store them into a collection.
3. There may be more than two words so we cannot apply filtering technique.
4. Now randomly guess the first word, until we got a hit. 5. Just make sure that we don't guess the same word again.
5. Select a random word from collection we have already extracted and then select a random character from that word.
6. Keep on randomly guessing, until we guess both the words and we run out of moves.

If the dictionary is more than 2^ max number of guess in hangman game then it is impossible unequal probability world. Each word you associate a prior probability (e.g. let's say there is a 0.00001 chance of the word being 'putrescent' and a 0.002 chance of the word being 'hangman'). An answer to a guess will either yield no letters, a single letter, or more than one letter (many possibilities). (Roald, 2020)

#### Rationale Behind Using This Approach

There are more than two words to guess in wheel of fortune. So, it is quite difficult to guess the correct word using the dictionary filtration and elimination technique because it requires a lot of computation and complexity. And most often results in false predictions. So it is best in this case that we use random guessing after just filtering the words from dictionary base on the lengths of the words.

### References for Optimal Algorithm for Winning Hangman

DataGenetics. (2020, October 2). A Better Strategy for Hangman. Retrieved from Data Genetics: http://www.datagenetics.com/blog/april12012/index.html

Roald. (2020, October 1st). Optimal Algorithm for Winning Hangman. Retrieved from Stack Overflow: https://stackoverflow.com/questions/9942861/optimal-algorithm-for-winning-hangman

Remember, at the center of any academic work, lies clarity and evidence. Should you need further assistance, do look up to our Computer Science Assignment Help

## Get It Done! Today

• 1,212,718Orders

• 4.9/5Rating

• 5,063Experts

### Highlights

• 21 Step Quality Check
• 2000+ Ph.D Experts
• Live Expert Sessions
• Dedicated App
• Earn while you Learn with us
• Confidentiality Agreement
• Money Back Guarantee
• Customer Feedback

### Just Pay for your Assignment

• Turnitin Report

\$10.00

\$9.00Per Page
• Consultation with Expert

\$35.00Per Hour
• Live Session 1-on-1

\$40.00Per 30 min.
• Quality Check

\$25.00
• Total

Free
• Let's Start

+ View More