Math Is Fun Forum

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

You are not logged in.

#1 2015-01-21 09:47:43

NickMeyers
Member
Registered: 2015-01-17
Posts: 46

Combination Problem #2

Thanks for the help with the last one!  I originally posted this in my old thread, but I think it got buried in there, and nobody saw it.

Here is the new problem with a narrowed range (>or = to 495 and < or = to 500 instead of 480-500) this time.
There are 4 players with the same value (in matches 5 and 7), they need to count as individuals even though they are the same cost.



Problem:

Contraints:
Only one player from each match can be used.
There are 10 matches (A vs B, C vs D, E vs F, etc.).
5 players must be picked.
The total combined cost of the 5 picked, must be > or = to 495 and < or = to 500 (495-500)
All combinations 494 and under, or over 500 are not important.
I need to be able to generate a list of combinations, that fit this criteria, along with associated costs.


Data Set:
Match    Cost
1    A    114   
      B    88
   
2    C    116   
      D    84
   
3    E    112
      F    87
   
4    G    102 
      H    98
5    I    104   
      J    96
   
6    K    103   
      L     97
   
7    M    104   
      N    96
   
8    O    106
      P    94
   
9    Q    120
      R    80
   
10   S   117   
      T    83

Results from the last one:

After using both forms of the results, Elaina's list was the easiest format to use.  I found it easier to search through when the numbers were used with the totals instead of the letters. This format:
{75, 80, 94, 118, 120, 487}
{75, 80, 94, 118, 127, 494}
{75, 80, 94, 120, 127, 496}

Even if there are players with the same cost, this still works for me, as long as there are counted and listed as individuals. The one like this last week were usable, there are 2 sets with the same costs this week.
{75, 94, 94, 109, 127, 499}
{75, 94, 94, 114, 118, 495}
{75, 94, 94, 114, 120, 497}

Let me know if I can clarify any questions.  Thank you for the help!!

Last edited by NickMeyers (2015-01-21 09:48:47)

Offline

#2 2015-01-22 14:03:05

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Combination Problem #2

I'm getting 686.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#3 2015-01-22 14:38:14

NickMeyers
Member
Registered: 2015-01-17
Posts: 46

Re: Combination Problem #2

Thank you Agnishom! Which program do you use to figure this out, and how hard would it be to use?

Any chance you could post the results again, with the numbers?

Offline

#4 2015-01-23 12:50:04

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Combination Problem #2

I'm using Mathematica like stefy and Elaina. But I have also solved it with Haskell. You can do it any language of your choice, like Python, too.

Mathematica or Haskell is slightly different than regular programming languages but you can still understand nothing and use my haskell script or stefy's mathematica command to solve your problem.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#5 2015-01-23 18:06:05

NickMeyers
Member
Registered: 2015-01-17
Posts: 46

Re: Combination Problem #2

Thank you so much! I won't have time to do more tutorials the next few days, but I will be back with another problem with the same scenario, with different numbers on Wednesday. 

I would love to learn how to use your Haskell script, I tried a few programming tutorials, and it's rough to get into with no background!!(http://learnyouahaskell.com/chapters).

In this problem, is it possible to designate the separate 104 and 96's as 104a, 104b, 96a, 96b? Will the program allow that? It would be helpful even though I said it was unnecessary in a previous post.  I am just exploring something, and the more I find out the more important the specific results become.

Thank you for the post Agnishom!  If its easy and you have time can you post the results with the 104 and 96 designated as separate? If it's a pain and can't be done before 1500 EST 1/24/2015 I won't be able to use it, but if you can it would be incredible!

Last edited by NickMeyers (2015-01-23 18:20:50)

Offline

Board footer

Powered by FluxBB