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

Hey MAS, I need Assignment Sample of

Distinctive Advantage

  • 21 Step Quality Check
  • 24/7 Customer Support
  • Live Expert Sessions
  • 100% Plagiarism Free Content
  • 0% Use Of AI
  • Guaranteed On-Time Delivery
  • Confidential & Secure
  • Free Comprehensive Resources
  • Money Back Guarantee
  • PHD Level Experts

All-Inclusive Success Package

  • Plagiarism Report

    FREE $10.00
  • Non-AI Content Report

    FREE $9.00
  • Expert Session

    FREE $35.00
  • Topic Selection

    FREE $40.00
  • DOI Links

    FREE $25.00
  • Unlimited Revision

    FREE $75.00
  • Editing/Proofreading

    FREE $90.00
  • Bibliography Page

    FREE $25.00
  • Get Instant Quote

Enjoy HD Grade Assignments without overpayingSave More. Score Better. Bless YOU!

Order Now

My Assignment Services- Whatsapp Get 50% + 20% EXTRAAADiscount on WhatsApp