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

Which function represents the graph below?
I NEED THE RIGHT ANSWER ASAP NO LINKS !!! What is a dynasty? 1: an empire in which women hold positions of power 2: a ruling family that remains in power for ma
How are the cells in the respiratory system helping with kicking a ball? Do some have specific jobs?​
write linear equatuon relating x and y for each table x (2,4,6,8). y (5,8,11,14)
Which of the following statements must be true based on the diagram below
Sophie invested $170 in an account paying an interest rate of 2\tfrac{3}{4}2 4 3 ​ % compounded continuously. Wyatt invested $170 in an account paying an intere
Please help !!!! I need this
The canine tooth of a Bengal tiger is 4 inches long. There are 2.54 centimeters in one inch. How long is the tooth in centimeters? Write an expression to show t
pls help me with this if u can
Has the deceased been under any professional treatment?​