Skip to content

Spring23-CS5008-BOS-Lionelle/hw2-guessing-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homework 02 - Guessing Game

Name:

Github Account name:

How many hours did it take you to complete this assignment (estimate)?

Did you collaborate with any other students/TAs/Professors? If so, tell us who and in what capacity.

  • one per row, add more if needed

Did you use any external resources (you do not have to cite in class material)? (Cite them below)

  • one row per resource

(Optional) What was your favorite part of the assignment?

(Optional) How would you improve the assignment?

Please responds to the following questions

  1. In the worst case, how many guesses would our guessing game take to get the right answer if we had no hints at all?

  2. In the worst case, how many guesses does it take to get the right number if we get a hint of "higher or lower" when guessing numbers 1-10 and guess intelligently (always picking in the middle of the remaining set of numbers)? Hint: In your answer, show this mathematically with the log function.

If you have questions about how to how to talk about this worst case, check out Chapter 1 of Grokking Algorithms. (see the syllabus for how to log on to O'Reilly Online for free). You only need to read the first half of the chapter to understand the reason for the maximum number of guesses; the second half of the chapter is useful, but we won't talk about big O notation and running time until next week.

Important notes

  • Your code must compile and run on the Khoury machines to earn credit. Make sure you test your programs on these machines, as this is where we grade your assignments.
  • You must commit any additional files(if any) into your repository so we can test your code.
    • Points will be lost if you forget!
  • Do not forget, once you have pushed your changes to your repo make sure that you submit them to Gradescope before the assignment deadline!

About

Guessing Game Homework Assignment

Topics

Resources

Stars

Watchers

Forks

Languages