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.
The resiliency technique which would provide the aforementioned capabilities is: D. Full backups.
An operating system (OS) can be defined as a system software which is pre-installed on a computing device, so as to manage or control software application, computer hardware and user processes.
In this scenario, a manufacturing company cannot migrate its several one-off legacy information systems (IS) to a newer operating system (OS), due to software compatibility issues.
Resiliency can be defined as a measure of the ability of a network, server, storage system, computing system or data center, to recover quickly and continue operating when it experience adverse conditions such as:
In Computers and Technology, there are four (4) main resiliency technique and these include:
I. Redundancy.
II. RAID 1+5.
III. Virtual machines.
IV. Full backups.
Full backup is a resiliency technique which create backups of the systems for recovery and it allows operating system (OS) patches to be installed on computer systems.
Read more: brainly.com/question/17586013
Answer:
nrToCheck = int(input("How many numbers do you need to check? "))
nrEven = 0
nrOdd = 0
for i in range(nrToCheck):
number = int(input("Enter number: "))
if (number % 2):
nrOdd = nrOdd + 1
print("{} is an odd number".format(number))
else:
nrEven = nrEven + 1
print("{} is an even number".format(number))
print("You entered {} even number(s).".format(nrEven));
print("You entered {} odd number(s).".format(nrOdd));