Blog

Geek Challenge Results: Matrix Mind-Boggler

Geek Challenge Results: Matrix Mind-Boggler

Congratulations to the winner of the Matrix Mind-Boggler Geek Challenge, Jordan Kuehn of the Colex Group!

Jordan wrote a program which generates random matrixes using an efficient technique. He gets extra props for including a DMC logo on his program! I added extra annotations to demonstrate how the solution works.

The key to solving the problem is noticing that each row and each column is used exactly once. Therefore, if each cell was the sum of numbers representing the row, and a number representing the column, the sum of these cells would equal the sum of the numbers representing the rows and columns.

Jordan’s program starts by generating 8 numbers which add up to the desired sum, 26.  Of these, 7 are selected randomly and the last one is 26 minus the sum of the random numbers. These 8 numbers are shown in the arrays to the left and bottom of the array. Then, the value of each cell in the array is calculated by summing the corresponding value from the array on the left and the array on the bottom. This matrix now has the property that any group of 4 cells on distinct rows and columns will add to 26.

For those versed in LabView programming, here is the program’s diagram (click to enlarge):

Submit your comments to geekchallenge@dmcinfo.com.

Learn more about DMC's LabVIEW programming services.

Comments

There are currently no comments, be the first to post one.

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above: