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, 20 Jun 2017 22:23:53 +0200Can I define a symbolic equation where the variables are concatenating?https://ask.sagemath.org/question/38009/can-i-define-a-symbolic-equation-where-the-variables-are-concatenating/Hi,
Can I define a symbolic equation with variable concatenating?
For example:
let $x \in \mathbb{F}_2$
How can I define the following equation:
$11111x1111 = 2*x + 2$
where the x is a digit in the left number.
(The obvious way is by taking the binary exression of that number i.e $\Sigma_{i=0}^{i=n}2^ib_i$)
Mon, 19 Jun 2017 09:27:43 +0200https://ask.sagemath.org/question/38009/can-i-define-a-symbolic-equation-where-the-variables-are-concatenating/Comment by dan_fulea for <p>Hi,
Can I define a symbolic equation with variable concatenating?</p>
<p>For example:</p>
<p>let $x \in \mathbb{F}_2$</p>
<p>How can I define the following equation:</p>
<p>$11111x1111 = 2*x + 2$</p>
<p>where the x is a digit in the left number. </p>
<p>(The obvious way is by taking the binary exression of that number i.e $\Sigma_{i=0}^{i=n}2^ib_i$) </p>
https://ask.sagemath.org/question/38009/can-i-define-a-symbolic-equation-where-the-variables-are-concatenating/?comment=38026#post-id-38026If x is in GF(2), it is not a "digit". The equality should work in integers? (The $2x+2$ is maybe either $2$, well $10$, but then... or $6$ ... The number on the left side is bigger.)Mon, 19 Jun 2017 21:24:54 +0200https://ask.sagemath.org/question/38009/can-i-define-a-symbolic-equation-where-the-variables-are-concatenating/?comment=38026#post-id-38026Answer by dom for <p>Hi,
Can I define a symbolic equation with variable concatenating?</p>
<p>For example:</p>
<p>let $x \in \mathbb{F}_2$</p>
<p>How can I define the following equation:</p>
<p>$11111x1111 = 2*x + 2$</p>
<p>where the x is a digit in the left number. </p>
<p>(The obvious way is by taking the binary exression of that number i.e $\Sigma_{i=0}^{i=n}2^ib_i$) </p>
https://ask.sagemath.org/question/38009/can-i-define-a-symbolic-equation-where-the-variables-are-concatenating/?answer=38038#post-id-38038Defining the equation is easy :
> x = var('x',domain='integer') res =solve([x^2 ==1,2^9+2^8+2^7+2^6+2^5+x+2^3+2^2+2^1+2^0 == 2*x+2],x)
> print "res = ",res # no solution
but like Dan Fuela pointed out, your equation has no solution when x in F2 + you should accept the fact that you mix up many things "the concatening operator" (no meaning in maths), F2 is for you exactly the same than the set of the two integers {0,1} and so on.Tue, 20 Jun 2017 22:23:53 +0200https://ask.sagemath.org/question/38009/can-i-define-a-symbolic-equation-where-the-variables-are-concatenating/?answer=38038#post-id-38038