Re: Question about an algorithm



On Jul 10, 9:52 pm, "John H Meyers" <jhmey...@xxxxxxxxxxxxxx> wrote:
On Mon, 09 Jul 2007 09:18:34 -0500, Gary wrote:
Problem: Given a set of points distributed (not necessarily evenly)
around the circumference of a circle, find the smallest number of
points in any semicircle.
My solution: Divide the circumference into an even number of equal
segments. Count the number of points in each segment. Some segments
may contain zero points. Store the segment frequencies in a list (the
order in the list representing position on circumference). Divide the
list in half and count the points in each half, storing the value that
is lowest. Now cycle the list, so that the entry in position 1 becomes
the entry in position n (the last position in the list). Repeat the
division of the list into two, and calculate the number of points in
each half, storing the lowest value. Continue cycling through the list
until you return to the original list. Now examine your list of
smallest counts, and find the minimum. That minimum is the smallest
number of points in any semicircle.

Possible problem: The accuracy of the algorithm will depend on
how finely the original circumference is divided.

Given that now we know this is just for a statistical measure
of non-uniformity, and also apparently that a very large number
of data points is involved, it's clear that we have no interest
in finding the theoretically exact answer, which makes quite
a difference in the approach to take; indeed, after knowing
what this is for, and that there is voluminous data,
I would take exactly this same approach -- divide the circle
into 90 or 100 parts, or as best suits the "coordinates"
in which these points are described, count how many points
lie in each part, and see which consecutive run of 45 or 50
segments (or half the region) has the lowest sum (the other half
necessarily has simultaneously the largest sum, since the grand
total is the constant entire population of points). There is
no value in estimating the answer to any better precision
than its uncertainty, anyway.

A slight computational time saving (offset by longer time
programming and debugging) can come from noting that as
we go from each summation run to the next, we simply
add in one new segment and drop one old segment each time,
so we don't necessarily have to repeat summing an entirely new
whole set of data each time.

People who design electromagnetic antennas, as well as those
who investigate many other physical phenomena, may also
be thinking that any circular distribution might be
describable as a superposition of a "monopole" component,
a "dipole," a "quadrupole," etc., and that this particular
measure is basically responding to only the first component
of this series -- but we always oversimplify things, don't we,
except in alternation with making them overly complex :)

-[ ]-

Thanks for the hint. Your help much appreciated.

Lance

.



Relevant Pages

  • Re: Question about an algorithm
    ... Count the number of points in each segment. ... order in the list representing position on circumference). ... number of points in any semicircle. ... I would take exactly this same approach -- divide the circle ...
    (comp.sys.hp48)
  • Re: Existence of reals and observation of them
    ... Each time you divide the difference is still non-zero, ... And, no, this way you can not divide a line segment into ... It will hit zero also, to an infinite decimal digit precision. ...
    (sci.math)
  • Re: Is a line segment composed of points?
    ... think that the line segment and the ... (A stupid definition, but that's the one you want) ... I divide the subject of the discussion into ... Fortunately for philosophers like you discussions seem to be pretty ...
    (sci.math)
  • Re: Reshape
    ... I have try using reshape to divide my image into 2 segment using ... BUT when i perform a diference to see if ...
    (comp.soft-sys.matlab)
  • Re: Cantors diagonal proof wrong?
    ... >> Nonesense. ... One can always divide a line segment into N equal parts by a ... >> well known geometric construction. ... So getting the point on the segment ...
    (sci.math)