Given an n by m matrix A, filled with only 0s and 1s, and an n by 1 matrix b, filled with non-negative integer values, I want to find the probability that a specific element of x is 1, if I were to choose a random m by 1 matrix x containing only 0s and 1s that solves the equation Ax = b.
Let me give an example.
A = [[1, 1],
[1, 1]]
x = [x_1, x_2]
b = [[1],
[1]]
The only solutions to Ax = b are x = |1 0| and x = |0 1|. Therefore, the probability of x_1 being 1 is 50% (or 0.5) and the probability of x_2 being 1 is also 50% (or 0.5). This is what I am trying to achieve, only for arbitrarily large matrices.
I know this can be done by brute force, by the time complexity is atrocious. Is there anyway to implement this (preferably in python), faster than brute-force?
Thanks!