English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Assignment x,y :=x+1, y-1
Expression 2*y-x

2006-10-06 04:40:37 · 2 answers · asked by Algorithim007 1 in Science & Mathematics Mathematics

2 answers

substitute the assignment in the expression and see if you get the same:

2(y-1) -(x+1)
2y-2-x-1
2y -x -3,
therefore it is not invariant

2006-10-06 07:22:50 · answer #1 · answered by Anonymous · 0 0

2y-x -> 2(y-1)-(x+1) = 2y-2-x-1 = 2y-x-3, so no, it's not invariant.

Just for fun: let x,y := x+a, y+b.

2y-x -> 2(y+b)-(x+a) = 2y+2b-x-a=(2y-x)+2b-a. So, if a=2b, then it is invariant.

2006-10-06 12:07:49 · answer #2 · answered by James L 5 · 0 1

fedest.com, questions and answers