Mathematica, 77(削除) 77 (削除ここまで) 50 bytes
Min@Outer[Mean@Mean@x[[##]]&,##,1]&@@(#~Subsets~±x_:=x~Subsets~{3}&)
Min[Mean/@Range@Dimensions[x=#]&@Mean/@±#&/@±#]&
Probably not optimal but is Mathematica's transposition operator (and is rendered as a superscript T in Mathematica).
This answer first defines a helper operator ± which returns all 3-element subsets of a list, and then evaluates to an unnamed function which uses this operator to solve the best I can come up with right now:problem.
- Get all subsets of 3 indices for rows and columns, respectively.
- For every pair of such subsets, extract the submatrix (which, conveniently, is as simple as
x[[##]]), and compute its mean. - Finally get the overall minimum.
This is done by first computing all 3-element subsets of the matrix's rows. Then for each such subset, we transpose it and compute its 3-element subset of rows. This gives us all possible 3x3 submatrices (although they are transposed). We then compute the mean on all of them and find the overall minimum.
Mathematica, 77 bytes
Min@Outer[Mean@Mean@x[[##]]&,##,1]&@@(#~Subsets~{3}&)/@Range@Dimensions[x=#]&
Probably not optimal but the best I can come up with right now:
- Get all subsets of 3 indices for rows and columns, respectively.
- For every pair of such subsets, extract the submatrix (which, conveniently, is as simple as
x[[##]]), and compute its mean. - Finally get the overall minimum.
Mathematica, (削除) 77 (削除ここまで) 50 bytes
±x_:=x~Subsets~{3}
Min[Mean/@Mean/@±#&/@±#]&
is Mathematica's transposition operator (and is rendered as a superscript T in Mathematica).
This answer first defines a helper operator ± which returns all 3-element subsets of a list, and then evaluates to an unnamed function which uses this operator to solve the problem.
This is done by first computing all 3-element subsets of the matrix's rows. Then for each such subset, we transpose it and compute its 3-element subset of rows. This gives us all possible 3x3 submatrices (although they are transposed). We then compute the mean on all of them and find the overall minimum.
Mathematica, 77 bytes
Min@Outer[Mean@Mean@x[[##]]&,##,1]&@@(#~Subsets~{3}&)/@Range@Dimensions[x=#]&
Probably not optimal but the best I can come up with right now:
- Get all subsets of 3 indices for rows and columns, respectively.
- For every pair of such subsets, extract the submatrix (which, conveniently, is as simple as
x[[##]]), and compute its mean. - Finally get the overall minimum.