easy sequences 33: web trapped ant -凯发k8网页登录
solution stats
problem comments
-
5 comments
my results are all different, although the formula gets the right result in all the simple cases like hs=h/2; ha=h/2; xs=0; xa=0; etc...
i’m checking my solution…
hi william,
i updated the test suites. i made a mistake in using full diameter instead of the semicircle's diameter. i also added a clarification to ensure only one option is considered.,
with regards to your solution. i think that your algorithm will work only if both the ant and spider are in the same side. please take note that the ant is inside and the spider is outside. please try again. thanks.
the dotted line doesn't show it, but presumably the spider has to go up, over the top edge of the can, and down again. also it can presumably choose whether to go clockwise or counterclockwise.
hi william, i've included one solution into the problem itself. i hope this clarifies everything. of course the circumference will not change. but if you would not consider inside/outside, the insects will appear to be closer together, and you will be get shorter distance than the correct one.
solution comments
problem recent solvers
suggested problems
-
316 solvers
-
427 solvers
-
1136 solvers
-
145 solvers
-
413 solvers
more from this author
problem tags
community treasure hunt
find the treasures in matlab central and discover how the community can help you!
start hunting!