Re: Simple Question



On 21 Sep 2006 18:06:05 GMT, Chris Foster <edolan@xxxxxx> wrote:

I have a simple question. This is a qustion that I was asked in a job
interview.


If there existed and infinite two dimewnsional array of 1 ohm resisters,
what is the resistance between two point seperated by a knights move (i.e.
up two, over one, or over two and up one.......etc...)

If I'm not slipping up, the resulting equation would be:

PI PI
/ /
1 | | 1 - cos( 2u + v )
R = ------ * | | ----------------------- du dv
4*PI^2 | | 2 - cos( u ) - cos( v )
/ /
-PI -PI

But thinking as a programmer, I'd probably just solve it numerically,
not through numerical or closed integration of the above, but instead
by:

(a) create a matrix V[] to represent the node voltages
(b) select some central point for A, call it V[x,y]
(c) arbitrarily initialize the matrix node values
to 0.5
(d) initialize matrix element V[x,y] to 0.0.
(e) initialize matrix element V[x+2,y+1] to 1.0.
(f) divide the grid into a checkerboard arrangement
with white and black (or red and black) squares
(g) process all the black squares, those not V[x,y]
or V[x+2,y+1], so that their new value is the
mean of the surrounding four nodes.
(h) process all the white squares, those not V[x,y]
or V[x+2,y+1], so that their new value is the
mean of the surrounding four nodes.
(i) until satisfied, go back to (g).
(j) add up the four node voltages adjacent to V[x,y]
into 'sum'
(k) print 1/(sum-4*V[x,y]) as the resistance.

Which looking at the near center of a 80x80 grid (probably close
enough) comes out to 0.7728 ohms.

Jon
.



Relevant Pages

  • Re: Simple Question
    ... If there existed and infinite two dimewnsional array of 1 ohm resisters, ... what is the resistance between two point seperated by a knights move (i.e. ... with white and black squares ... mean of the surrounding four nodes. ...
    (sci.electronics.basics)
  • Re: Simple Question
    ... If there existed and infinite two dimewnsional array of 1 ohm resisters, ... what is the resistance between two point seperated by a knights move (i.e. ... with white and black squares ... mean of the surrounding four nodes. ...
    (sci.electronics.basics)

Loading