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:
A and C
Explanation:
Option A:
In IPv6 there is a rule to reduce an IPv6 address when there are two or more consecutive segments of zeros just one time. This rule says that you can change the consecutive zeros for “::”
Here is an example
How to reduce the following IPv6 address?
ff02:0000:0000:0000:0000:0000:0000:d500
Ans: ff02::d500
Example 2:
2001:ed02:0000:0000:cf14:0000:0000:de95
Incorrect Answer -> 2001:ed02::cf14::de95
Since the rule says that you can apply “::” just one time, you need to do it for a per of zero segments, so the correct answer is:
Correct Answer -> 2001:ed02::cf14:0:0:de95
Or
2001:ed02:0:0:cf14::de95
Option C:
Since in IPv6 there are
available addresses which means 340.282.366.920.938.463.463.374.607.431.768.211.456 (too many addresses), there is no need of NAT solution, so each device can have its own IP address by the same interface to have access through the internet if needed. If not, you can block the access through internet by the firewall.
Answer:
Explanation:
it is important to be succinct, and help the reader to find the information that they need quickly, and without wading through reams of superfluous information. formatting of table plays an important role in presenting the data clearly and scuccinctly.
Answer:
Days of the week including weekends Fill Weekdays – you can autofill working days of the week excluding weekends. This is very cool. I can autofill dates excluding the weekends. Fill Months – and you can use the full word or a standard abbreviation for the month, and Excel will autofill the sequence.
Explanation:
Answer:
The web browser sends an HTTP request to the IP address, the IP address then sends the content that are displayed by the browser
Explanation:
The process of converting the typed in URL to a displayed page is as follows;
1) The typed in URL is sent to a DNS recursor by the browser
2) The recursor gets the DNS record for the domain from the cache if the record is cached or when the DNS record for the domain is not cached, the recursor makes a requests to the DNS root from which the name of the TLD nameserver is received
3) The TLD nameserver is contacted by the resolver to obtain the authoritative nameserver's IP address
4) With the information, the resolver contacts the authoritative nameserver and obtains the domain's IP address for the domain the resolver contacts
5) The obtained IP address for the URL's domain is then sent to the browser by the resolver
6) An HTTP request is sent by the browser to the IP address and the data received by the browser from that IP address is rendered and seen as the page content.