Which of the following would be the best y-axis label for the graph?
A. Time-steps
B. Percentage Cleaned
C. Aspect Ratio
D. Number of Robots
E. Distance Travelled
查看答案
Examine showPlot1 in ps2.py, which takes in the parameters title, x_label, and y_label. Your job is to examine the code and figure out what the plot produced by the function tells you. Try calling showPlot1 with appropriate arguments to produce a few plots. Then, answer the following 3 questions.Which of the following would be the best title for the graph?
A. Percentage Of Room That A Robot Cleans
B. Time It Takes 1 - 10 Robots To Clean 70% Of A Room
C. Percentage Of Room That 1 - 10 Robots Clean
D. Time It Takes 1 - 10 Robots To Clean 80% Of A Room
E. Time For Robots To Clean Varying Percentages Of A Room
F. Area Of Room That 1 - 10 Robots Clean
Which of the following alterations (Code Sample A or Code Sample B) would result in a deterministic process?import random # Code Sample A mylist = [] for i in xrange(random.randint(1, 10)): random.seed(0) if random.randint(1, 10) > 3: number = random.randint(1, 10) if number not in mylist: mylist.append(number) print mylist # Code Sample B mylist = [] random.seed(0) for i in xrange(random.randint(1, 10)): if random.randint(1, 10) > 3: number = random.randint(1, 10) mylist.append(number) print mylistCheck one, none, or both.
A. Code Sample A
B. Code Sample B
Is the following code deterministic or stochastic?import random mylist = [] for i in xrange(random.randint(1, 10)): random.seed(0) if random.randint(1, 10) > 3: number = random.randint(1, 10) mylist.append(number) print mylist
A. Deterministic
B. Stochastic
2. If you were going to use random.seed in a real-life simulation instead of just when you are debugging a simulation, would you want to seed it with 0?
A. Yes
B. No