ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 04 Jun 2019 17:23:47 +0200express an affine space as linear system of equationshttps://ask.sagemath.org/question/46793/express-an-affine-space-as-linear-system-of-equations/Given an affine space, for example {25,27,29,31} in $\mathbb{F}_2^4$, how can I find the equations to express the space as $Ax=b$. I believe there must be some commands in sage can help me. But I can not find them. Tue, 04 Jun 2019 13:17:43 +0200https://ask.sagemath.org/question/46793/express-an-affine-space-as-linear-system-of-equations/Answer by tmonteil for <p>Given an affine space, for example {25,27,29,31} in $\mathbb{F}_2^4$, how can I find the equations to express the space as $Ax=b$. I believe there must be some commands in sage can help me. But I can not find them. </p>
https://ask.sagemath.org/question/46793/express-an-affine-space-as-linear-system-of-equations/?answer=46796#post-id-46796Is it homework ? Here are some hints:
- if you remove the first element to all elements of an affine space, you get a vector space (see `VectorSpace` and its `vector_space_span` method)
- this vector space has a basis
- turn this basis into a matrix M (by columns)
- the lines of the matrix A you are looking for are a basis of the right kernel of M (write the things down on a paper to get convinced)
- you get the b by plugging any element of your affine space in the equationTue, 04 Jun 2019 17:23:47 +0200https://ask.sagemath.org/question/46793/express-an-affine-space-as-linear-system-of-equations/?answer=46796#post-id-46796