Something a Little Different 2

Algebra Level 3

Let M M be the set of all 3 × 3 3 \times 3 matrices with entries all equal to either 0 0 or 1 -1 . What is the average determinant of the matrices in M M ?

3 -1 1 0 9

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.

1 solution

Kyle T
Jun 24, 2019
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
//start with array 0 and -1 (think of this as the number in the top left corner)
$arr = array(array(0), array(-1));
//continue adding numbers until each aray has 9 values (imagine this as a 3x3 matrix reading left to right, top to bottom)
do {
    $newarr = array();
    foreach($arr as $a){
        $newarr[] = array_merge($a,[0]);
        $newarr[] = array_merge($a,[-1]);
    }
    $arr = $newarr;
} while(count($arr[0])<9);

/*
Matrix
$a[0] $a[1] $a[2]
$a[3] $a[4] $a[5]
$a[6] $a[7] $a[8]
*/

//compute the determinant for each array
//https://www.mathsisfun.com/algebra/matrix-determinant.html
$d = array();
foreach($arr as $a){
    $d[] = $a[0]*(($a[4]*$a[8])-($a[5]*$a[7])) - $a[1]*(($a[3]*$a[8])-($a[5]*$a[6])) + $a[2]*(($a[3]*$a[7])-($a[4]*$a[6]));
}

//calculate the average (sum/count), this is our answer
echo array_sum($d)/count($d); //answer: 0

//to better explain why this is our answer, lets look at the different values for our determinants and the count for each value
$dcount = array();
foreach($d as $v){
    if(!isset($dcount[$v])){
        $dcount[$v] = 0;
    }
    $dcount[$v]++;
}
echo '<pre>'.print_r($dcount,true).'</pre>';
/*
Array
(
    [0] => 338
    [1] => 84
    [-1] => 84
    [-2] => 3
    [2] => 3
)
*/

//So we can see most often the determinant is 0, but the values range from -2 to 2. 
//The counts for 1 and -1, as well as 2 and -2 match. 
//So when we take the sum of the array it will return 0; and 0 over anything is still 0.
?>

Now, can you show it mathematically?

Hamza A - 1 year, 11 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...