0
$\begingroup$

I am not very well educated in math and I have a math puzzle that I'm trying to solve. I have the following list and each object has 3 numbers. The first 2 numbers are better when they are as high as possible and the last number is bad when it is a high number.

DWTI 90.07, 28.57, 14.29
DGAZ 75.84, 42.86, 14.29
JNUG 44.9, 28.57, 14.29
SQQQ 18.2, 14.29, 14.29
TLL 89.5, 14.29, 28.57
ENRJ 23.41, 42.86, 14.29
ASPS 7.46, 14.29, 14.29
TKMR 39.88, 42.86, 0
GENE 239.09, 71.43, 0
ZIOP 82.71, 42.86, 0

How can I create a math formula/what math formula could I use to order them with the following names at the top of the list (in any order): ENRJ, GENE, ZIOP, DWTI

I'm looking to create a math formula like this (I know this one doesn't work but this is just an example) ((1st number + 2nd number) - 3rd number) / 3

Data in copyable form:

data ={{DWTI, 90.07`, 28.57`, 14.29`}, {DGAZ, 75.84`, 42.86`, 14.29`}, 
 {JNUG, 44.9`, 28.57`, 14.29`}, {SQQQ, 18.2`, 14.29`,  14.29`}, 
 {TLL, 89.5`, 14.29`, 28.57`}, {ENRJ, 23.41`, 42.86`,  14.29`},
 {ASPS, 7.46`, 14.29`, 14.29`}, {TKMR, 39.88`, 42.86`,  0},
 {GENE, 239.09`, 71.43`, 0}, {ZIOP, 82.71`, 42.86`, 0}}
$\endgroup$
3
  • $\begingroup$ It is difficult to tell form the way you phase your question whether you are looking for Mathematica code or just a generat algorithm. Beyond that I don't think you have given enough detail for anyone to come up with an answer; certainly I can not. $\endgroup$
    – m_goldberg
    Commented Mar 21, 2015 at 21:23
  • $\begingroup$ @m_goldberg I edited my question to hopefully explain better. I'm looking for a general algorithm and I hope I gave enough details $\endgroup$
    – DarthVegan
    Commented Mar 21, 2015 at 21:29
  • $\begingroup$ SortBy[data, {0,1,1,-1}.#&]//Reverse $\endgroup$ Commented Mar 21, 2015 at 22:05

1 Answer 1

1
$\begingroup$

With the posted data, it is impossible to get the four rows (ENRJ, GENE, ZIOP, DWTI) to rank higher than other rows using linear scoring rules

topfour = {a, b, c}.# & /@ Rationalize[Cases[data, 
  {Alternatives @@ {ENRJ, GENE, ZIOP, DWTI}, _, _, _}][[All, 2 ;;]]];
others = {a, b, c}.# & /@ Rationalize[Cases[data, 
  {Except[Alternatives @@ {ENRJ, GENE, ZIOP, DWTI}], _, _, _}][[All, 2 ;;]]];
ineqs = And @@ Join @@ (Thread[# > others] & /@ topfour);

Reduce[ineqs, {a, b, c}, Reals]
(* False *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.