This problem’s question: What is the most frequent absolute value of the determinant of all possible 2x2 matrices with integer elements with values from -9 to 9 inclusive?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Very similar methodology.
Log in to reply
Are you unhappy with our solutions?
Log in to reply
No, I am happy with your solutions.
I never learned to program in PHP. Python, I learned and did not like Python -- significant spaces was a great source of problems in programs written by a group and extremely hard to find and the internal documentation of the compiler and runtime was miserable. That is why the programs I write in this site's coding environment are in in C/C++ or Rust.
I was commenting that the algorithm in the PHP and Python programs offered as solutions are very similar to the algorithm in the solution I offered -- not better nor worse.
My solution in Python:
1 2 3 4 5 6 7 8 9 10 |
|
Very similar methodology.
Computer solution (the language is Wolfram Mathematica 12): First [ SortBy [ Tally [ Flatten [ Table [ Abs [ Det [ ( a c b d ) ] ] , { a , − 9 , 9 } , { b , − 9 , 9 } , { c , − 9 , 9 } , { d , − 9 , 9 } ] ] ] , − # [ [ 2 ] ] & ] ] ⇒ { 1 2 , 3 5 6 8 }
Problem Loading...
Note Loading...
Set Loading...
My solution in PHP