DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Where are my math wizards? Need help with algebraic set puzzle algorithm thing  (Read 6,047 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
I could use some help with this and i'm not sure where to start other than just playing with rows and columns on paper -- thought maybe someone here might have an idea.

I've been working on a board game idea recently, and i have an idea i want to play with regarding bidding.

I think the best way to describe what i want is a table of numbers, with X rows and Y columns, such that:
  • No number in a cell is ever repeated
  • The columns all sum to the same number (doesn't matter what that number is)

The numbers in cells should be positive, and ideally as low as possible, but that is not critical.

To help motivate what this is for, i was thinking of giving each player a set of "bidding cards", where every card is unique and therefore there can never be a tie, but where every player has the same average bidding strength.  So in my table above, each column represents the bidding cards of a single player.

To make it more concrete, i'm thinking of something like 6 players (columns) and 10-15 bidding cards (rows) each.

Any thoughts?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
ah ok i have a solution (works for any number of players and even number of cards per person, i.e. rows).. shall i wait to post it to give you guys a chance to come up with solution ?  ;)
« Last Edit: April 07, 2010, 08:02 PM by mouser »

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
shall i wait to post it to give you guys a chance to come up with solution ?
Not if you're waiting for an answer from me  :P

y not, if x=y?
Chris

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Here is a big clue:

Click to reveal big clue on how to solve
Draw a 2x2 table that solves for 2 player with 2 cards each, numbered 1-4, and look at the geometric pattern in your table, now reproduce for more players and cards.

tsaint

  • Hi from the a*** end of the earth
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 497
I guess you're saying to try an algorithm like this:
row 1: start counting from 1st element in row  ie 1 2 3
row 2: keep counting , but this time start from second element in row and then cycle back to 1st element ie 6 4 5
row 3: keep counting , but this time start from third element in row and then cycle back to 1st element ie 8 9 7

That gives constant totals for each column... but what about randomness for each player for the game?
I guess you could
a. interchange columns randomly
b. add and subtract random amounts from random selections in a column -
      the add would need to take the element to >x.y,
      the subtract could take the balancing element to negative
      then add a constant to all elements in the matrix to eliminate negatives
c. find minimum element in the matrix and reduce this, and all other elements by whats needed to get the min value to 1.
After making a nice cup of tea, voila, an apparently random matrix meeting requirements. Maybe.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
I have this silly notion that I'm pretty good at math, but I don't think I even understand what you're requesting in the original post.

Original address: https://www.donationcoder.com/forum/index.php?topic=22353.0