Re: Rings on a matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg108566] Re: Rings on a matrix
- From: mokambo <alexandrepassosalmeida at gmail.com>
- Date: Tue, 23 Mar 2010 05:52:21 -0500 (EST)
- References: <ho4gqd$jk0$1@smc.vnet.net> <ho778a$12k$1@smc.vnet.net>
On Mar 22, 7:46 am, "Sjoerd C. de Vries" <sjoerd.c.devr... at gmail.com> wrote: > 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, 1= 6, > > 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 Thank you for your answer Sjoerd. But your solution gives a perfect ring while what I was looking for has a different pattern. I managed to find a solution involving a congruential inequality. Alex