Skip to content

Homework Submission: Simulations #3

Description

@shruthim0

DUE: Thursday by 7:00 pm

Submit your homework for Unit 3 Lesson 16!
Make sure you submit the Student Copy notebook, WITH your extra notes & class activities, not the lesson plan one :)

Rubric:
Class activities done and extra notes (hacks 1-2): 0.3 points
Unit 3 Lesson 16 homework (hacks 2-5) with explanations/comments: 0.6 points
Unit 3 Lesson 16 Hack 6 challenge (your own simulation): 0.02-0.05 points, extra :)
Any other extra effort can contribute to your grade.

Hack#3
Using Binary for Simulations
Now you will combine everything we have talked about so far, plus binary. Imagine that there is a zombie apocalypse. A household with 8 survivors is observed. Let's create a simulation where we see how many of the people have been transformed into zombies. This will involve three functions.

  1. First, a function for randomizing decimal number 0-255
  2. Next, a function for converting this to a 8-bit binary number (one bit per person)
  3. Lastly, a function to read the binary bits, and assign each person a label (zombie or naw) based on the position of 0s and 1s

The amount of people who are zombies is randomly determined. Based on the placement of the 1s and 0s in the 8 bit number, each person is assigned as being a zombie or not
Grades

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions