Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    $\begingroup$ It seems like there's a tiny bug in the code you wrote: in both places, don't you mean Outer[ and not Outer,? When I make that fix, diameter[pointset] gives 2 Sqrt[5]. $\endgroup$ Commented Sep 17, 2014 at 0:55
  • $\begingroup$ Also, you're likely better off using Subsets[x,{2}] to accomplish what you're doing with Flatten and Outer. It should reduce redundant calculations. $\endgroup$ Commented Sep 17, 2014 at 1:00
  • $\begingroup$ @evanb Thank you; Firstly, for pointing out that typo. What I intended was for it to be Outer[, as you spotted. However, diameter[pointset] still gave me that long output. Secondly, for pointing out the Subsets[] Command, I didn't know it exist. $\endgroup$ Commented Sep 17, 2014 at 1:13
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ Commented Sep 17, 2014 at 12:36