1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vsevolod [243]
3 years ago
8

The idea is to simulate random (x, y) points in a 2-D plane with domain as a square of side 1 unit. Imagine a circle inside the

same domain with same diameter and inscribed into the square. We then calculate the ratio of number points that lied inside the circle and total number of generated points.
Computers and Technology
1 answer:
jok3333 [9.3K]3 years ago
6 0

Answer:

For calculating Pi (π), the first and most obvious way is to measure the circumference and diameter.

π = Circumference / diameter

For the random points in the 2-D plane, we calculate the ratio of number points inside the circle and generate random pairs and then check

x² + y² < 1

If the given condition is true, then increment the points and used them. In randomized and simulation algorithms like Monte Carlo. In this case, if the number of the iteration is more then more accurate, the result is.

Explanation:

For simulating the random points in 2-D using Monte Carlo algorithms:

Monte Carlo

In this algorithm, we calculate the ratio of the number of points that lied in the circle. We do not need any graphics or simulations to generated points. In this, we generate random pairs and check x² + y² < 1.

π ≅ 4 × N inner / N total

The other way for calculating Pi (π) is to use Gregory-Leibniz Series.

Series which converges more quickly is Nilakangtha Series, which is developed in the 15th century. It is the other way to calculate Pi (π).

You might be interested in
What is a WYSIWIG program
jeyben [28]

Answer:

WYSIWYG means "what you see is what you get ".

Explanation:

It is type of editor or program that helps while creating a document. This program allows us to see the end result while creating a document i terms of who document will look like after completion.

4 0
3 years ago
What is the meaning of N.W.O​
Likurg_2 [28]

Answer:

The New World Order (NWO) in conspiracy theories is the hypothesis of a secretly emerging totalitarian world government.

8 0
3 years ago
 Formulas within table cells always begin with
Delicious77 [7]
(D) I don't know about other spread sheet software, but in Microsoft Excel, a formula is always entered beginning with an 'equals' sign. ( = ).
4 0
3 years ago
Switched Ethernet, similar to shared Ethernet, must incorporate CSMA/CD to handle data collisions. True False
valentinak56 [21]

Answer:

False

Explanation:

The Carrier-sense multiple access with collision detection (CSMA/CD) technology was used in pioneer Ethernet to allow for local area networking.  Carrier-sensing aids transmission while the collision detection feature recognizes interfering transmissions from other stations and signals a jam. This means that transmission of the frame must temporarily stop until the interfering signal is abated.

The advent of Ethernet Switches resulted in a displacement of the CSMA/CD functionality.

4 0
3 years ago
Copy the main given below. Write the methods needed to produce the output given. YOU SHOULD NOT CHANGE MAIN
Bad White [126]

Answer:

C++ code explained below

Explanation:

CODE

#include <iostream>

using namespace std;

// prototypes go here

void getInput(double *l, double *w) {

cout << "Enter Length: ";

cin >> *l;

if(*l < 0) {

return;

}

cout << "Enter Width: ";

cin >> *w;

while(*w < 0) {

cout << "Width must be positive! Try Again" << endl;

cout << "Enter Width: ";

cin >> *w;

}

}

double calculations(double l, double w, double *perimeter) {

*perimeter = 2 * (l + w);

return l*w;

}

void printResults(double l, double w, double perimeter, double area) {

cout << "Rectangle Dimensions: " << l << " X " << w << endl;

cout << "perimeter: " << perimeter << endl;

cout << "Area: " << area << endl;

return;

}

int main()

{

double t;

// test(&t);

double length;

double width;

double perimeter;

double area;

//below line has to change if you need to work this example

//reason is length and width are local variable to main so other function can only change if address is passed so i have plase & sign before the variables while passing

//same has to be done for perimeter

getInput(&length, &width);

while (length >= 0)

{

area = calculations(length, width, &perimeter);

printResults(length, width, perimeter, area);

getInput(&length, &width);

}

}

4 0
3 years ago
Other questions:
  • Before you take any medicine, _____ to see if it could affect your ability to drive.
    8·2 answers
  • I am confused in Java!
    12·1 answer
  • ___ apps can allow you to lock your mobile device and sim card remotely.
    15·1 answer
  • What is important for an internet user to know about https:// ?
    9·1 answer
  • The domain in an email message tells you what?
    11·1 answer
  • ____ is another term for document properties.
    12·1 answer
  • Which of the following is a trend in Internet computing? People are shifting back to using desktop computers more than mobile de
    5·2 answers
  • categorize each job role as an administrative job or management job auditor director legal secretary payroll clerk etc ​
    8·1 answer
  • expand and explain HTML and css. mention the role of each one in web pages imagine how a page without css will look like​
    7·1 answer
  • 1 point
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!