# Simulation - problem of maximization inside a circle

I am doing some projects related to statistics simulation using R based on "Introduction to Scientific Programming and Simulation Using R". In the Students projects session (chapter 24), I am doing the "The pipe spiders of Brunswick" problem. At the end of this project, he asks if there is any way where you can design a web spider that has a efficiency of at least 45. A web spider is made of segments from points in the circle border, as we can see below: In this project a web spider is created inside a circle of radio 1, and its efficiency is calculated as follows:

100*p - a,

where

p = probability of a fly is caught by the web. Flies are randomly generated inside the circle

a = length of the web

So clearly there is a trade-off, if the web is bigger, certainly it will catch more flies, but it will have a higher "cost". I am trying to figure out how to design a web with higher efficiency based on this information, all I know is that the ideal would be that the strands of the web do not cross each other too much.

• +1 Cool problem. "...he asks if there is any way where you can design a web spider that has a efficiency of at least 45." Does this mean (a) he wants to know if it is possible? or (b) he wants to know an algorithm to find the solution efficiently? If it is (a), one could use a brute force approach and simulate it an arbitrarily large number of times. This is very inefficient, but as long as one simulation has an efficiency greater than 45, you have your answer. Also, could you provide us with any code you have written so far that tries to answer the question? – Mark White Dec 20 '18 at 4:38
• wait, how big are these flies? – Taylor Dec 20 '18 at 5:32
• where you say "a web spider" do you instead mean a spider web? – Glen_b Dec 20 '18 at 16:56