Saturday, March 31, 2012

Magic Squares - Explained


Magic Squares - explained
=========================

Here is a 3 x 3 magic square.



- the rows add up to T = 15.
- the columns add up to T
- the diagonals add up to T

Here's how to do it:

x 1 x ----- x 1 x   -----  x 1 x
x x x  ----- x x x  ----- 3 x x
x x x  ----- x x 2  ----- x x 2


x 1 x  -----  x 1 x ----- x 1 6
3 x x  ----- 3 5 x ----- 3 5 x
4 x 2  ----- 4 x 2  ----- 4 x 2


x 1 6  ----- 8 1 6  -----  8 1 6
3 5 7  ----- 3 5 7  ----- 3 5 7
4 x 2  ----- 4 x 2  ----- 4 9 2


1. Start from top row middle column with S=1, S is the starting value.
2. Add 2,3,4,5,6,7,8,9 diagonally, that means try to go UP then RGIHT.
3. If UP is blocked, go to Right column, and fill the bottom row. eg. like filling "2".
4. If RIGHT is blocked, go to the LEFT most column of one row above, eg like filling "3".
5. Since this is a 3x3 square, after 3 numbers, then fill the next number just one row DOWN.
eg like filling in "4".
6. Repeat from step 3.

To generalize to N x N magic squares (MS), where N is ODD,
- in step 5 above, after filling every N numbers, move down exactly ONE row.
- the movement of UP -> RIGHT, that is diagonally, is same for all N x N magic squares.
- the relationship between the starting number S and the total number T is like this.
for 3x3 MS:   T / 3 - 4 = S       , 3 x 1 + 1 = 4
for 5x5 MS:   T / 5 - 12 = S      , 5 x 2 + 2 = 12
for 7x7 MS:   T / 7 - 24 = S      , 7 x 3 + 3 = 24
for 9x9 MS:   T / 9 - 40 = S      , 9 x 4 + 4 = 40
for NxN MS:   T / N - K  = S      , N x (N-1)/2 + (N-1)/2 = N*N/2 - 1/2

- The sum of all rows or columns or diagonal T, must be divisible by N.
- For any N, the minumum S is 1.
- For any N, the constant K = N*N/2 - 1/2
- For any N, the minimum T is when S = 1,
   so Tmin = (1 + N*N/2 - 1/2 ) * N

Sunday, March 04, 2012

How to Boost Your Broadband Speed

Here are 10 very simple tips to increase broadband speeds and links to several useful tools.

1. Test Your TV
Apart from TV there are other electrical equipment that can cause interference.

2. Avoid Extension Wiring - longer wire has poorer signals

3. Tweak your Wifi -
NetStumbler software (www.netstumbler.com/downloads) - use to which WiFi channels your neighbours are using.

4. Get Diagnosed - get help from your ISP.

5. Sort your system
Use unblocka (www.unblocka.com) to tune your settings to improve speed.

6. Keep your router up to date

7. Fine Tune MTU settings
MTU is one of the modem settings that can be changed. It controls the packet size of transmission. To identify issues with MTU - see www.pcauthority.com.au/links/129broad1. A guide on how to adjust MTU is found in www.dslreports.com/tweaks/MTU . Also the Speed Guide TCP Optimizer (www.speedguide.net/downloads.php) will identify the optimal MTU.

8. Ask for Interleaving
If you cannot solve your interference problems, you may be able to ask your ISP to switch on interleaving to improve performance. This essentially chops the packet into smaller pieces and has better error correction. This improve stability but may increase or decrease speed.

9. Replace your filters
A guide to test filters can be found at: www.pcauthority.com.au/links/129broad2

The technical details of what the inside of a filter looks like can be found in (www.adslnation.com/support/filters.php)

10. Watch out for AR7 routers
Routers with the AR7 chipset is known to have a fault so may cause connection to drop out. To find a list of router models containing this chipset, go to www.linux-mips.org/wiki/AR7
Firmware updates for some routers to correct this issue may be listed in www.pcauthority.com.au/links/129broad3