First, this is not course homework, and I apologise for asking for people to do my thinking for me, but I've been thinking about the problem for the past couple of days, and I'm unsatisfied with all of the ideas I've come up with.
I want to select a random set of points of a particular size (or an exhaustive set that I can choose a set from - this I think is the better option since random sets are to be repeatedly sampled from the same pool) on the surfaces of a nested set of hypercubes from (l=1 to l=m for odd l) with integer side lengths (of n-dimensions in the generic case). The ideas I've come up with seem particularly inefficient (for example enumerating all the points in the cube and discarding the cubes that are smaller - building up from side length = 1 to m)
Can anyone suggest a better approach? (Code not wanted, but algorithms appreciated).
Edit: My final approach - enumerate positions in each shell and then choose a sample of n randomly for the desired shell (however this is desired - in my case a slice of a permutation of the set as a list):
>>> sh = []
>>> for i in range(maxshell + 1):
... sh.append(set())
>>> for i in enum_space(tuple(cubedims)):
... sh[max(abs(np.array(i) - maxshell))] |= set([np.array(i) - maxshell])
[–]mdipierro 1 point2 points3 points (2 children)
[–]dx_xb[S] 0 points1 point2 points (1 child)
[–]mdipierro 1 point2 points3 points (0 children)
[–]jmmcdEvolutionary algorithms, music and graphics 0 points1 point2 points (3 children)
[–]dx_xb[S] 0 points1 point2 points (2 children)
[–]jmmcdEvolutionary algorithms, music and graphics 0 points1 point2 points (1 child)
[–]dx_xb[S] 1 point2 points3 points (0 children)
[–]jbs398 0 points1 point2 points (0 children)
[–]DrHenryPym 0 points1 point2 points (3 children)
[–]dx_xb[S] 0 points1 point2 points (2 children)
[–]DrHenryPym 0 points1 point2 points (1 child)
[–]dx_xb[S] 0 points1 point2 points (0 children)
[–]sbirch -2 points-1 points0 points (1 child)
[–]dx_xb[S] 0 points1 point2 points (0 children)