ayushpoudel833 ayushpoudel833
  • 21-06-2021
  • Computers and Technology
contestada

write an algorithm to find perimeter of circle
​

Respuesta :

sk5634943
sk5634943 sk5634943
  • 28-07-2021

Answer:

Here’s one!

Given [math]R[/math], the radius of the circle.

Let [math]N,D\leftarrow 0[/math]

Repeat until [math]D[/math] is large enough (about 1,000,000)

[math]x,y\leftarrow U[0,1][/math]

If [math]x^2 + y^2\le 1[/math] then [math]N\leftarrow N+1[/math]

[math]D\leftarrow D+1[/math]

[math]P\leftarrow\frac{8NR}{D}[/math]

Return [math]P[/math]

[math]U[0,1][/math] is a uniform random number in the range [math][0,1][/math].

Explanation:

Answer Link

Otras preguntas

Newborn human babies with lesser body weight are prone to infections. Heavier babies are difficult to deliver through the narrow pelvic passage of human mothers
what kind of countires existed in Ancient Greece
What is the answer in this question ? Macy is painting a design that contains two repeating patterns.One pattern repeats every 8 inches.The other repeats every
what is a low,wet area where grasses,rushes and cattails grow
Use properties to find the sum or product  9×52
The Compromise of 1850 was proposed by: a. Daniel Webster b. Zachary Taylor c. Henry Clay d. John C. Calhoun
What is ax - x = c for x
What is 1/10 of 3000
Factoring quadratics 15x+25x^2
A Rate Is A Ratio That Compares Two Quantities with different units True Or False ? Why?