Message Boards Message Boards

0
|
2018 Views
|
6 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Determine a rational matrix with rational variables

Posted 1 year ago

I have the following matrix, where all the elements and the variables are rationals:

{{1/4 (6 x + Sqrt[2] Sqrt[1 - 2 x^2]), 
  1/4 (-2 x + 3 Sqrt[2] Sqrt[1 - 2 x^2]), 1/
  2}, {1/4 (6 x - Sqrt[2] Sqrt[1 - 2 x^2]), 
  1/4 (2 x + 3 Sqrt[2] Sqrt[1 - 2 x^2]), 1/2}, {x, Sqrt[1 - 2 x^2]/
  Sqrt[2], 1}}

I want to determine the variable in the matrix so that it meets the above conditions. Any tips for solving this problem?

Regards,
Zhao

POSTED BY: Hongyi Zhao
6 Replies
Posted 1 year ago

If the imaginary part is 0, then this is a real value function. However, I still cannot find the value of rational number as the corresponding common parameter of all these functions, so that these functions have rational function values.

POSTED BY: Hongyi Zhao
Posted 1 year ago

However, these figures do not seem to give intuitive hints about the problems discussed here: Find the rational solutions.

POSTED BY: Hongyi Zhao

... these figures do not seem to give intuitive hints about the problems discussed here: Find the rational solutions.

These figures show ReImPlot: The red dotted line is the imaginary part - in sections where it is 0 we have a rational solution. Or did I misunderstand the problem?

POSTED BY: Henrik Schachner
Posted 1 year ago

Yes. FindInstance will give the solution:

In[33]:= matrix = {{1/4 (6 x + Sqrt[2] Sqrt[1 - 2 x^2]), 
1/4 (-2 x + 3 Sqrt[2] Sqrt[1 - 2 x^2]), 
1/2}, {1/4 (6 x - Sqrt[2] Sqrt[1 - 2 x^2]), 
1/4 (2 x + 3 Sqrt[2] Sqrt[1 - 2 x^2]), 1/2}, {x, 
Sqrt[1 - 2 x^2]/Sqrt[2], 1}};
equation = 0 == Numerator@Together[(1 - 2 (a/b)^2)/2 - (n/m)^2]
sol = FindInstance[equation && a b m n != 0, {a, b, m, n}, Integers]
matrix /. x -> a/b /. sol

Out[34]= 0 == -2 a^2 m^2 + b^2 m^2 - 2 b^2 n^2

Out[35]= {{a -> -1, b -> -2, m -> -2, n -> -1}}

Out[36]= {{{1, 1/2, 1/2}, {1/2, 1, 1/2}, {1/2, 1/2, 1}}}

But Solve still can't solve this problem:

In[31]:= sol = Solve[equation && a b m n != 0, {a, b, m, n}, Integers]
matrix /. x -> a/b /. sol

During evaluation of In[31]:= Solve::svars: Equations may not give solutions for all "solve" variables.

Out[31]= {{n -> 
   ConditionalExpression[-(Sqrt[-2 a^2 m^2 + b^2 m^2]/(
     Sqrt[2] Abs[b])), Or[
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a >= 1, 
      b > 2^Rational[1, 2] (a^2)^Rational[1, 2], m <= -1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a >= 1, m >= 1, 
      b > 2^Rational[1, 2] (a^2)^Rational[1, 2]], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a >= 1, 
      b < -2^Rational[1, 2] (a^2)^Rational[1, 2], m >= 1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a >= 1, 
      b < -2^Rational[1, 2] (a^2)^Rational[1, 2], m <= -1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], m >= 1, a <= -1, 
      b > 2^Rational[1, 2] (a^2)^Rational[1, 2]], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], b < -2^Rational[1, 2] (a^2)^Rational[1, 2], 
      m >= 1, a <= -1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], b < -2^Rational[1, 2] (a^2)^Rational[1, 2], 
      a <= -1, m <= -1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a <= -1, 
      b > 2^Rational[1, 2] (a^2)^Rational[1, 2], m <= -1]]]}, {n -> 
   ConditionalExpression[Sqrt[-2 a^2 m^2 + b^2 m^2]/(Sqrt[2] Abs[b]), 
    Or[
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a >= 1, 
      b > 2^Rational[1, 2] (a^2)^Rational[1, 2], m <= -1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a >= 1, m >= 1, 
      b > 2^Rational[1, 2] (a^2)^Rational[1, 2]], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a >= 1, 
      b < -2^Rational[1, 2] (a^2)^Rational[1, 2], m >= 1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a >= 1, 
      b < -2^Rational[1, 2] (a^2)^Rational[1, 2], m <= -1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], m >= 1, a <= -1, 
      b > 2^Rational[1, 2] (a^2)^Rational[1, 2]], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], b < -2^Rational[1, 2] (a^2)^Rational[1, 2], 
      m >= 1, a <= -1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], b < -2^Rational[1, 2] (a^2)^Rational[1, 2], 
      a <= -1, m <= -1], 
And[
Element[
Alternatives[
       a, b, m, 
        2^Rational[-1, 2] ((-2) a^2 m^2 + b^2 m^2)^Rational[1, 2]/Abs[
        b]], Integers], a <= -1, 
      b > 2^Rational[1, 2] (a^2)^Rational[1, 2], m <= -1]]]}}

Out[32]= {{{1/4 (Sqrt[2] Sqrt[1 - (2 a^2)/b^2] + (6 a)/b), 
   1/4 (3 Sqrt[2] Sqrt[1 - (2 a^2)/b^2] - (2 a)/b), 1/
   2}, {1/4 (-Sqrt[2] Sqrt[1 - (2 a^2)/b^2] + (6 a)/b), 
   1/4 (3 Sqrt[2] Sqrt[1 - (2 a^2)/b^2] + (2 a)/b), 1/2}, {a/b, Sqrt[
   1 - (2 a^2)/b^2]/Sqrt[2], 
   1}}, {{1/4 (Sqrt[2] Sqrt[1 - (2 a^2)/b^2] + (6 a)/b), 
   1/4 (3 Sqrt[2] Sqrt[1 - (2 a^2)/b^2] - (2 a)/b), 1/
   2}, {1/4 (-Sqrt[2] Sqrt[1 - (2 a^2)/b^2] + (6 a)/b), 
   1/4 (3 Sqrt[2] Sqrt[1 - (2 a^2)/b^2] + (2 a)/b), 1/2}, {a/b, Sqrt[
   1 - (2 a^2)/b^2]/Sqrt[2], 1}}}

Furthermore, is there a general approach to dealing with this type of problem rather than just an analysis based on one of its specific elements?

POSTED BY: Hongyi Zhao

is there a general approach to dealing with this type of problem ...

Not a good mathematical approach as that of Gianluca, but my very first attempt would be a graphical inspection of the elements - simply like so (let mat be your matrix):

MatrixForm @ Map[ReImPlot[#, {x, -3, 3}, ReImStyle -> {Black, {Thick, Red}}] &, mat, {2}]

enter image description here

POSTED BY: Henrik Schachner

It seems that the matrix is rational whenever (1 - 2 x^2)/2 is rational. Call x=a/b: then

matrix = {{1/4 (6 x + Sqrt[2] Sqrt[1 - 2 x^2]), 
    1/4 (-2 x + 3 Sqrt[2] Sqrt[1 - 2 x^2]), 
    1/2}, {1/4 (6 x - Sqrt[2] Sqrt[1 - 2 x^2]), 
    1/4 (2 x + 3 Sqrt[2] Sqrt[1 - 2 x^2]), 1/2}, {x, 
    Sqrt[1 - 2 x^2]/Sqrt[2], 1}};
equation = 0 == Numerator@Together[(1 - 2 (a/b)^2)/2 - (n/m)^2]
sol = FindInstance[equation && a b m n != 0, {a, b, m, n}, Integers]
matrix /. x -> a/b /. sol
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract