Re: Rings on a matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg108533] Re: Rings on a matrix
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Mon, 22 Mar 2010 02:39:36 -0500 (EST)
- References: <ho4gqd$jk0$1@smc.vnet.net>
Not sure I understand your problem, but would the difference of two DiskMatrices be useful? n = 10; ArrayPlot[DiskMatrix[n, 2 n + 2] - DiskMatrix[n - 1, 2 n + 2], Mesh -> All] This generates one ring. You can get more if you add matrices with samller or larger rings. Cheers -- Sjoerd On Mar 21, 9:11 am, mokambo <alexandrepassosalme... at gmail.com> wrote: > I'm having a problem trying to find a procedure to generate rings in a > matrix. Here are 3 steps of the algorithm (if it exists): > Use ArrayPlot[%, Mesh -> True] for quick visualization. > > 1 ring at iteration 1: > {{0, 0, 0, 0}, {0, 1, 1, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}} > > 2 rings at iteration 2: > {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 8, 8, 0, 0, 0}, > {0, 0, 8, 0, 0, 8, 0, 0}, {0, 8, 0, 8, 8, 0, 8, 0}, > {0, 8, 0, 8, 8, 0, 8, 0}, {0, 0, 8, 0, 0, 8, 0, 0}, > {0, 0, 0, 8, 8, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}} > > 4 rings at iteration 3: > {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 16, > 16, 16, 16, 16, 16, 0, 0, 0, 0, 0}, {0, 0, 0, 16, 16, 16, 0, 0, 0, > 0, 16, 16, 16, 0, 0, 0}, {0, 0, 16, 16, 16, 0, 0, 16, 16, 0, 0, 16, > 16, 16, 0, 0}, {0, 0, 16, 16, 0, 16, 16, 0, 0, 16, 16, 0, 16, 16, 0, > 0}, {0, 16, 16, 0, 16, 16, 0, 16, 16, 0, 16, 16, 0, 16, 16, 0}, {0= , > 16, 0, 0, 16, 0, 16, 0, 0, 16, 0, 16, 0, 0, 16, 0}, {0, 16, 0, 16, > 0, 16, 0, 16, 16, 0, 16, 0, 16, 0, 16, 0}, {0, 16, 0, 16, 0, 16, 0, > 16, 16, 0, 16, 0, 16, 0, 16, 0}, {0, 16, 0, 0, 16, 0, 16, 0, 0, 16, > 0, 16, 0, 0, 16, 0}, {0, 16, 16, 0, 16, 16, 0, 16, 16, 0, 16, 16, 0, > 16, 16, 0}, {0, 0, 16, 16, 0, 16, 16, 0, 0, 16, 16, 0, 16, 16, 0, > 0}, {0, 0, 16, 16, 16, 0, 0, 16, 16, 0, 0, 16, 16, 16, 0, 0}, {0, 0, > 0, 16, 16, 16, 0, 0, 0, 0, 16, 16, 16, 0, 0, 0}, {0, 0, 0, 0, 0, > 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0}} > > I've tried just 1/4 of the problem (due to symmetries) and playing > with the circle equation and measuring distances from > points in a lattice. I've tried DiskMatrix but can't find a recursion > to generate the examples. Any ideas, hints? > Is there a way to solve this problem (Congruence equations perhaps?) > > Alex