Results 1 to 8 of 8
  1. #1
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Hornsby Heights, New South Wales, Australia
    Posts
    3,822
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How many squares ?

    are there in total ?
    <table align="center"><tr><td align="center"><table border="1"><tr><td width="10" height="10">
    Cheers, Claude.

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How many squares ?

    They all look like rectangles to me <img src=/S/grin.gif border=0 alt=grin width=15 height=15>.

    Alan

  3. #3
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Hornsby Heights, New South Wales, Australia
    Posts
    3,822
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How many squares ?

    ok, how many squares (or rectangles, depending on your browser settings) are there ? <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Cheers, Claude.

  4. #4
    Star Lounger
    Join Date
    Apr 2003
    Location
    Edinburgh, Midlothian, United Kingdom
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How many squares ?

    <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">none? they all only have 2 sides?</span hide>

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How many squares ?

    <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">There are 12*12 squares of size 1 by 1, 11*11 squares of size 2 by 2, etc. So the total number is

    12*12 + 11*11 + ... + 2*2 + 1*1 = 650

    The general formula for an n by n grid is n*(n+1)*(2*n+1)/6</span hide>

  6. #6
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How many squares ?

    If you are wanting total SQUARES then...
    <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">12*12 + 6*6 + 4*3 + 1 = 193</span hide>
    Regards,
    Rudi

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Hornsby Heights, New South Wales, Australia
    Posts
    3,822
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How many squares ?

    while you got the correct result, I think it's a lot simpler to use this formula: (1 + 2 + 3 ... + 12)
    Cheers, Claude.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How many squares ?

    That's basically what I had, but how are you going to compute that quickly for, say, a 50 by 50 grid?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •