All problems
Chi Square Expected Cell Count
Problem
For a contingency table under independence, the expected count of a cell is row_total * col_total / grand_total.
Given the row total, the column total, and the grand total, return the expected count.
Hint
The margins determine the expected joint count.
Test cases
case 1
in: [30,50,100]
expected: 15
case 2
in: [10,20,200]
expected: 1
case 3
in: [45,90,300]
expected: 13.5
Starter codePython
def chi_square_expected_cell_count(row_total, col_total, grand_total):
# Your code here
pass3 test cases · run your code against them in the editor