Loading web-font TeX/Math/Italic
Jump to content

Recommended Posts

Posted

Hello! 

I'm building a rebase algorithm that I need some help with. These are the variables, constants, and constraints (the values themselves are just examples):

Set of variables 1:

  • a1 = 1934464428151493937044
  • b = 54802476401439357
  • c = 1e18
  • result1 = ?

Set of variables 2:

  • a2 = 1837741206733939183658
  • b = 54802476401439357
  • c = 1e18
  • result2 = ?

Final invariant --> result1 == result2

As you can see b and c are constants and the only variables shared between sets, so you can't use a1 during the operations of Set 2 and vice versa (a1 and a2 might fluctuate in value, but not b and c).

Also, result1 is not known during the operations for result2, and vice versa.

The idea is to have result1 to equal result2. Feel free to add more variables, constants, escalating factors, etc. if you need them in order to achieve the final idea.

 

Thanks!

 

Posted

Something is missing in this definition. As it is described, the simple solution would be just to have a "result" some constant or, more generally, independent on the variable "a".

Posted
  On 2/20/2024 at 12:03 AM, Genady said:

Something is missing in this definition. As it is described, the simple solution would be just to have a "result" some constant or, more generally, independent on the variable "a".

Expand  

Perhaps that something that's missing is the clarification that a1 and a2 are the only actual variables (while b and c are the constants)? 

You can also introduce more variables/constants in your end, if that helps to achieve the invariant of result1 === result2. 

Posted
  On 2/20/2024 at 4:40 PM, dNY said:

Perhaps that something that's missing is the clarification that a1 and a2 are the only actual variables (while b and c are the constants)? 

You can also introduce more variables/constants in your end, if that helps to achieve the invariant of result1 === result2. 

Expand  

So, what is wrong with defining, say, result1==result2==5?

Posted
  On 2/20/2024 at 4:43 PM, Genady said:

So, what is wrong with defining, say, result1==result2==5?

Expand  

You can't know result1 on the calculation of result2, and vice versa.

Each one happens in their own separate environment at runtime, so to say that result2 is equal to result1 in result2's environment, you'd need to know result1 beforehand, thus breaking this invariant.

Posted (edited)
  On 2/20/2024 at 6:54 PM, dNY said:

You can't know result1 on the calculation of result2, and vice versa.

Each one happens in their own separate environment at runtime, so to say that result2 is equal to result1 in result2's environment, you'd need to know result1 beforehand, thus breaking this invariant.

Expand  

Let "result" to be a b's digit of the number \pi.

I don't know it beforehand, but they will be equal.

Edited by Genady

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.