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 appreciated



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
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
Get step-by-step solutions from verified subject matter experts
