Hongyi Zhao on Sun, 08 Jan 2023 04:21:18 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Solve an non-homogeneous system of equations mod Z. |
On Sun, Jan 8, 2023 at 1:49 AM Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote: > > On Sat, Jan 07, 2023 at 09:29:55PM +0800, Hongyi Zhao wrote: > > On Sat, Jan 7, 2023 at 5:31 PM Bill Allombert > > > One possible solution > > > Take w = [0,0,1/4]~ > > > > This solution is not given in advance. We need to find such things > > first. How did you find such a solution? > > You should start by replacing mat1 by matriqz(mat1,-2) as I suggested. There is a typo in the command "matriqz" mentioned above, which should be written as "matrixqz". IIRC, as far as this problem is concerned, you haven't mentioned matrixqz in the whole discussion process. > Then everything is be easier. For example > > mat1 = [ -210, -210, -220; -221, -222, -232; 410, 411, 430 ]; > vec1 = [ -27, -28, 105/2 ]~; > M1 = matrixqz(mat1,-2) > B1 = matinverseimage(mat1,M1) > x1 = B1*matsolvemod(M1,2,2*vec1)/2 > \\%64 = [3/7, 1/42, 0]~ > mat1*x1-vec1 > \\%65 = [-68, -72, 133]~ Thank you for your complete example. It can solve the problem. Another puzzle for me is that I actually hope to combine PARI/GP and GAP to carry out relevant work. But I'm not sure if there is a way to completely embed the above code in the GAP script. Although there is a related GAP package alnuth [1], its features seem to be very limited. > So you get a solution. However, based on our previous discussions and the general characteristics of this problem, I still have the following questions: 1. For a problem like this, if there are solutions, then there should be infinitely many solutions, how do I find and represent all of them in a reasonable form? 2. How to quickly determine if there is no solution? [1] https://www.gap-system.org/Packages/alnuth.html > Cheers, > Bill. Best, Zhao