Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 Help Me ! » Need formula for determining Column and Row » 2012-03-07 14:56:33

rickg
Replies: 3

Given a matrix where there is some varying number of columns and rows I need to calculate for any given 'tile' its ROW and COLUMN.
Example, a matrix that has 3 columns and 3 rows will have a total of 9 tiles and tile#4 will be in the 1st column, 2nd row, whereas if it were a 4X4 matrix tile#4 would be in the 4th column, first row.

So the knowns at any given time are tileNumber, numberOfRows, and numberOfColumns. From those variables I want a calculation for the associated column and row for any given TileNumber.

FYI The matrixes will all have equal col/row (3X3, 4X4, 5X5)

The needed formulas:
Column = SomeFormula(tileNumber,NumberofRows)
Row = SomeFormula(tileNumber,NumberofColumns)
*keep in mind numberOfRows and numberOfColumns will always be equal in this particular exercise.

Example 3X3 matrix with associated tileNumbers.  So tileNumber 4 in this example has a row value of 2 and a column value of 1.
1 | 2 | 3
4 | 5 | 6
7 | 8 | 9

Board footer

Powered by FluxBB