Question: I need help figuring out this assignment in Python. I figured out a way to plot points around the circle, but I keep getting one

I need help figuring out this assignment in Python. I figured out a way to plot points around the circle, but I keep getting one wonky point by starting at 0 for the angle. I also need to connect the dots around the circle with probability p, so I am trying to generate a random integer between 0 and 1 to compare to probability p to decide whether to plot the circle. The problem is, I'm not sure how to backtrack to the other points I made to connect them, and I am unsure of the coordinates. I included the book example as well. Any help is appreciatedI need help figuring out this assignment in Python. I figured outa way to plot points around the circle, but I keep gettingone wonky point by starting at 0 for the angle. I alsoneed to connect the dots around the circle with probability p, so

1.5.19 in the textbook Compose a program that takes as command-line arguments an integer n and a float p (between 0 and 1), plots n equally spaced points of size on the circumference of a circle, and then, with probability p for each pair of points, draws a gray line connecting them. See example output in your text book. 16 .125 16.25 16.5 16 1.0 n = = = import sys import stdio import math import random import stddraw import pygame int(sys.argv[1]) p float(sys.argv[2]) r = .5 num_degrees_apart float(360) num_points point_set = 0 stddraw.setXscale(-1,1) stddraw.setYscale(-1,1) while num_points

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To tackle this assignment we need to focus on a few key pieces Generating equally spaced points on the circle Using the probability p to decide whethe... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!