public function getWeightVariance(): float
    {
        $mean = $this->getMeanWeight();

        $weightVariance = 0;
        /** @var PackedBox $box */
        foreach ($this->list as $box) {
            $weightVariance += ($box->getWeight() - $mean) ** 2;
        }

        return round($weightVariance / count($this->list), 1);
    }
public function getWeightVariance(): float
    {
        $mean = $this->getMeanWeight();

        $weightVariance = 0;
        /** @var PackedBox $box */
        foreach ($this->list as $box) {
            $weightVariance += ($box->getWeight() - $mean) ** 2;
        }

        return round($weightVariance / count($this->list), 1);
    }
public function getWeightVariance ( ) : float { $ mean = $ this -> getMeanWeight ( ) ; $ weightVariance = 0 ; /** @var PackedBox $box */ foreach ( $ this -> list as $ box ) { $ weightVariance += ( $ box -> getWeight ( ) - $ mean ) ** 2 ; } return round ( $ weightVariance / count ( $ this -> list ) , 1 ) ; }
Calculate the variance in weight between these boxes.

@return float
Calculate the variance in weight between these boxes .