Hongyi Zhao on Sat, 07 Jan 2023 02:15:22 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Solve an non-homogeneous system of equations mod Z.


On Fri, Jan 6, 2023 at 10:33 PM Aurel Page <aurel.page@normalesup.org> wrote:
>
> On 06/01/2023 15:15, Hongyi Zhao wrote:
> >>> I also tried the following, but still failed:
> >>>
> >>> ? mat1 = [ -210, -210, -220; -221, -222, -232; 410, 411, 430 ]
> >>> %8 =
> >>> [-210 -210 -220]
> >>>
> >>> [-221 -222 -232]
> >>>
> >>> [ 410  411  430]
> >>>
> >>> ? vec1 = [ -27, -28, 105/2 ]
> >>> %9 = [-27, -28, 105/2]
> >>>
> >>> ? matsolvemod(mat1,[1,1,1],vec1~,1)
> >>>    ***   at top-level: matsolvemod(mat1,[1,1,1],vec1~,1)
> >>>    ***                 ^---------------------------------
> >>>    *** matsolvemod: incorrect type in matsolvemod (D) (t_VEC).
> >>>    ***   Break loop: type 'break' to go back to GP prompt
> >>
> >>    vec1 should be a column, either use
> >>
> >> vec1 = [ -27, -28, 105/2 ]~
> >>
> >>    or
> >>
> >> vec1 = Col([ -27, -28, 105/2 ])
> > Thank you for your correction.
> >
> >>     (same thing for [1,1,1]). Additionally, vec1 has non integral entries, and
> >>    it is not permissible for matsolvemod.
> > But in my case, I must tackle non-integral entries, as you've seen. Is
> > there no way to solve the problem?
> Your equation is linear, multiply everything by the denominator!

I tried the following method, but failed:

? mat1 = [ -210, -210, -220; -221, -222, -232; 410, 411, 430 ]
%1 =
[-210 -210 -220]

[-221 -222 -232]

[ 410  411  430]

? vec1 = [ -27, -28, 105/2 ]~
%2 = [-27, -28, 105/2]~
? matsolvemod(mat1,[1,1,1]~, 2 * vec1~,1)
  ***   at top-level: matsolvemod(mat1,[1,1,1]~,2*vec1~,1)
  ***                 ^------------------------------------
  *** matsolvemod: incorrect type in matsolvemod (Y) (t_VEC).
  ***   Break loop: type 'break' to go back to GP prompt
break>

> Best,
> Aurel

Regards
Zhao