Ask Your Question
0

Enumerate all solutions to linear system over finite field

asked 2015-11-28 12:16:35 -0500

d125q gravatar image

updated 2015-11-28 12:17:15 -0500

Assume I have a matrix $A$ and a vector $b$, both over some finite field $\mathrm{GF}(q)$. I would like to enumerate _all_ solutions to $A x = b$ (there are only finitely many).

I can generate a particular solution using A \ b and I can generate the nullspace of $A$ using A.right_kernel(), but how should I combine the two to enumerate all solutions?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-11-28 12:36:54 -0500

d125q gravatar image

updated 2015-11-28 12:37:10 -0500

Okay, I found the solution. Finite vector spaces support iteration, so one can simply do:

particular_soln = A.solve_right(b)
for homogeneous_soln in A.right_kernel():
    particular_soln + homogeneous_soln
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-11-28 12:16:35 -0500

Seen: 149 times

Last updated: Nov 28 '15