Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Problem 1

Cubes: A number raised to the third power is a cube. Plot the first five cubic numbers, and then plot the first 5000 cubic numbers.

Problem 4

Modified Random Walks: In the class Randomwalk, x_step and Y_step are generated from the same set of conditions. The direction is chosen randomly from the list \([1,-1]\) and the distance from the list \([0,1,2,3,4]\). Modify the values in these lists to see what happens to the overall shape of your walks. Try a longer list of choices for the distance, such as 0 through 8 , or remove the \(-1\) from the \(x\) or \(y\) direction list.

Problem 6

Automatic Labels: Modify die.py and dice_visual.py by replacing the list we used to set the value of hist.x_labels with a loop to generate this list automatically. If you're comfortable with list comprehensions, try replacing the other for loops in die_visual.py and dice_visual.py with comprehensions as well.

Problem 7

Two D8s: Create a simulation showing what happens if you roll two eight-sided dice 1000 times. Increase the number of rolls gradually until you start to see the limits of your system's capabilities.

Problem 8

Three Dice: If you roll three D6 dice, the smallest number you can roll is 3 and the largest number is 18 . Create a visualization that shows what happens when you roll three D6 dice.

Problem 9

Multiplication: When you roll two dice, you usually add the two numbers together to get the result. Create a visualization that shows what happens if you multiply these numbers instead.

Access millions of textbook solutions in one place

  • Access over 3 million high quality textbook solutions
  • Access our popular flashcard, quiz, mock-exam and notes features
  • Access our smart AI features to upgrade your learning
Get Vaia Premium now
Access millions of textbook solutions in one place

Recommended explanations on Computer Science Textbooks