Table width issue and cell size calculation

woodjom

New member
Joined
Mar 19, 2010
Messages
4
Got a bit of a quandry for an equation. This is to be used for a Table object in programming.

Here are the parameters
  • X is greater than Y[/*:2xso2sse]
  • X and Y must each be greater than 40 but less than 100[/*:2xso2sse]
  • There are 3 X's and 3 Y's for a total of 6 points[/*:2xso2sse]
  • The Sum of all X's must be divisible by 3[/*:2xso2sse]
  • The Sum of all Y's must be divisible by 3[/*:2xso2sse]
  • The Sum of all the X's and Y's equals 500, no more and no less[/*:2xso2sse]
  • X and Y are both whole numbers, fractions not allowed for pixels :wink: [/*:2xso2sse]

It would be great if some of you math gurus could solve this puzzle and if possible supply a generic equation. Since i am templating this object, i need to be able to apply the same algorithm to several unknown widths, in the future.
 
Hello, woodjom!

Some clarification, please . . .


Here are the parameters:

. . [1] X and Y are integers.

. . [2] X is greater than Y.

. . [3] X and Y must each be greater than 40 but less than 100.

. . [4] There are 3 X's and 3 Y's for a total of 6 points.

. . [5] The sum of all X's is divisible by 3.

. . [6] The sum of all Y's is divisible by 3.

. . [7] The sum of all the X's and Y's equals exactly 500


I don't understand [4].

\(\displaystyle \text{How are }X_1,X_2,X_3\,\text{ and }\,Y_1,Y_2,Y_3\,\text{ paired into six points?}\)

. . \(\displaystyle \text{and if we knew this, how would it help in the solving?}\)


\(\displaystyle \text{[5], [6], and [7] are contradictory.}\)

. . \(\displaystyle \begin{array}{cccc}\text{[5] says:} & X_1 + X_2 + X_3 &=& 3a \\ \text{[6] says:} & Y_1+Y_2+Y_3 &=& 3b \\ \text{[7] says:} & 3a + 3b &=& 500 \end{array}\)

 
Graphically, [4] is similar to a HTML Table.
- 1 row, 6 cells, with X & Y being paired (cell1 = x, cell2 = y, cell3 = x, cell4 = y, cell5=x, cell6=y)

X and Y are representative for the Width value of each of its respective cells. All X cells will have the same width and all Y cells will have the same width.

Think of [5] and [6] more of a grouping of similar width cells. Of which, from my calculations should be divisible by 3 with no remainder (so a Modulus check should work find as long as it returns 0) for instance, 3a % 3 = 0

Assuming the value limitation of [3], 40<b<a<100, and [5] & [6] check out, then [7] would result in 3a + 3b = 500, for this example.

I would like to generalize the equation as a whole and make it so that way i can have 400, 800, 900, 1200, or any number in the middle. Obviously, i will need to put a governor on the pixel value and move away from prime numbers, or number not divisible by a single-digit prime, etc.

[Edited on 3/22/2010]
I maybe being repeatitive in the modulus aspect but just want to make sure. If validating the modulus is repeatitive then dont worry about it, but just like to have checks and balances in place when i incorporate a calculation algorithm.
 
Top