Skip to content
DeepForgeby svx
All problems
MediumInformation Theoryinfo-118

MRC Weights

Problem

Return the normalized maximal-ratio combining weights. Each raw weight is g_i / n_i; scale the vector so that the sum of squares of the weights is 1. Return the resulting list.

Hint

Weights favor strong channels and quiet branches.

Test cases

case 1
in: [[1,1],[1,1]]
expected: [0.7071067811865475,0.7071067811865475]
case 2
in: [[3,4],[1,1]]
expected: [0.6,0.8]
case 3
in: [[1,0],[1,1]]
expected: [1,0]
case 4
in: [[2,1],[1,4]]
expected: [0.9922778767136677,0.12403473458920847]
Starter codePython
import math
def mrc_weights(gains, noise_vars):
    # Your code here
    pass

4 test cases · run your code against them in the editor