Answer:
import numpy as np
import matplotlib.pyplot as plt
def calculate_pi(x,y):
points_in_circle=0
for i in range(len(x)):
if np.sqrt(x[i]**2+y[i]**2)<=1:
points_in_circle+=1
pi_value=4*points_in_circle/len(x)
return pi_value
length=np.power(10,6)
x=np.random.rand(length)
y=np.random.rand(length)
pi=np.zeros(7)
sample_size=np.zeros(7)
for i in range(len(pi)):
xs=x[:np.power(10,i)]
ys=y[:np.power(10,i)]
sample_size[i]=len(xs)
pi_value=calculate_pi(xs,ys)
pi[i]=pi_value
print("The value of pi at different sample size is")
print(pi)
plt.plot(sample_size,np.abs(pi-np.pi))
plt.xscale('log')
plt.yscale('log')
plt.xlabel('sample size')
plt.ylabel('absolute error')
plt.title('Error Vs Sample Size')
plt.show()
Explanation:
The python program gets the sample size of circles and the areas and returns a plot of one against the other as a line plot. The numpy package is used to mathematically create the circle samples as a series of random numbers while matplotlib's pyplot is used to plot for the visual statistics of the features of the samples.
Answer:
Parent
Explanation:
HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.
Generally, all HTML documents are divided into two (2) main parts; body and head. The head contains information such as version of HTML, title of a page, metadata, link to custom favicons and CSS etc. The body of a HTML document contains the contents or informations that a web page displays.
In this scenario, Roger wants to give semantic meaning (an element conveying informations about the type of content contained within an opening and closing tag) to a contact information placed at the bottom of a webpage. Thus, in order to do this, he should use a footer element as a parent of the contact information and as such all instance variables that have been used or declared in the footer class (superclass) would be present in its contact information (subclass object).
An Output report is known to be the various findings that has been generated or it is said to be the result of a given program outcome.
<h3>What is an output report?</h3>
An output is known to be a file that has been produced by the system when a user is said to have submitted a Program, Report Set, etc. for execution.
Note that to be able to compile the GPSSWorld program, one has to use a statistical software to create the output and charts, and then one can copy and paste the results unto any given word processor software where one can construct a table for it.
Learn more about output reports from
brainly.com/question/11599232
#SPJ1
"Key logger" This could be software or hardware that does this.