The quadrifolium (as shown) is a polar-coordinate equation � = sin(2�).

computer science


 The quadrifolium (as shown) is a polar-coordinate equation � = sin(2�). This equation represents a plant with 4 leaves, and never mind what plant it represents (I won’t argue with you if you say it’s the “lucky clover”). I make a box (−1,1) × (−1,1) to enclose the quadrifolium. Your test requires you to write a program to throw a needle of length � for 10! times to the box and compute the probability of your needle touching the curve (count it one time if your needle touches 2+ spots of the curve, per throw), for needle lengths � = 0.1, 0.25, 0.5, 1.0.

“My” backyard is a squared 100x100 section of the Amazon forest where 9 trees uniformly distributed at spots whose coordinates are drawn from (�", �")~�(0, 100) where �(0, 100) means uniform random numbers ∈ (0, 100). Their heights are drawn from a normal distribution �"~�(10, 1.777#) where the height mean � = 10 and � = 1.777 is the standard deviation (and �# is the variance). With such info, generate the 3d coordinates of all trees. 

Related Questions in computer science category