Problem 58847. Possible American Football Scoring Combinations
- Touchdown - 6 points
- Try after touchdown - 1 point
- Try after touchdown - 2 points
- Safety - 2 points
- Field Goal - 3 points
- Defensive safety on try after touchdown (i.e. conversion safety) - 1 points
- Defensive "touchdown" on try after touchdown - 2 points
Solution Stats
Problem Comments
-
8 Comments
I'll admit I don't understand the example given. Based on the problem description, you would expect that t1_combs*s (where s = [6 3 2 1 2 1 2].') is equal to s1*ones(height(t1_combs, 1)), and dto. for t2_combs, but this isn't true for the given example (where the results are, instead, [4 3 3].' and [5 4 7 8].').
Also, the second constraint -- total number of defensive scores is bounded by the opposing team's touchdowns means that t1_combs and t2_combs cannot be considered in isolation since whether a combination for (say) team 1 is valid depends on the combination (not just score!) of team 2.
The columns in the matrix have a different order than in the problem description. From what I figured out, it should be:
1. Touchdown - 6 points
2. Try after touchdown - 1 point
3. Try after touchdown - 2 points
4. Safety - 2 points
5. Field Goal - 3 points
6. Defensive safety on try after touchdown (i.e. conversion safety) - 1 points
7. Defensive "touchdown" on try after touchdown - 2 points
Thanks, Stefan! I'll take another look keeping in mind your ordering.
Thank you so much for the edit @Stefan, my apologies on the mistake and confusion; I updated the problem statement to reflect the order you listed
My apologies @Christian for the sloppy problem writing on my part, I understand the frustration my error may have caused you
@Josh no worries, it happens.
The test suite only accepts one particular order of combinations. This disqualifies valid answers, and discourages original solutions. it could be improved by sorting the rows before comparison:
'assert(isequal([sortrows(t1_combs);sortrows(t2_combs)],[sortrows(team1);sortrows(team2)]))
@Alex thank you for the feedback, i'm all about encouraging creativity in solution methods and would like adjust the test suite to be more accommodating
i understand that your proposed solution seeks to sort the rows in each combination matrix as a means of accounting for differences in solutions' column/header arrangements, i'm not clear on how that ensures accurate solutions though because what about in cases where there are repeat values (e.g. # of tds, # of fgs, # of off./def. pats, etc.)
would it not be possible for a rows in a matrix that is incorrect to be sorted and subsequently match a solution, albeit by a chance that is somewhat rare. i might be wrong as i am not quite proficient at this stuff. would a more robust test suite ask for solutions to submit their column headers as well or to pair up the variables and their associate values in a table? maybe even ramp it up to a string/sentence describing the outcome. it seems like the latter might be overcomplicating the problem that's mean to be focused on solving a system of equations versus also testing string creation/manipluation
thank you for your help!
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
Check if number exists in vector
12047 Solvers
-
513 Solvers
-
555 Solvers
-
231 Solvers
-
check whether a number is a pentatope number
61 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!