Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to reverse a tangential algorithm

4 views
Skip to first unread message

Bart Van der Donck

unread,
Oct 21, 2006, 5:29:31 AM10/21/06
to
Hello,

Say I have the following:

1. x = value between 0.0000001 and 0.9999999
2. x = 1 + x
3. x = tangent of x
4. x = x % 1
5. repeat steps 2 to 4 ten times
6. show new value of x

Is there a way to revert this calculation ?

%1 is the 'modulus arithmetic operator', the remainder after the
division by (in this case) 1.

Thank you

--
Bart

Daniel Mayost

unread,
Oct 21, 2006, 12:59:47 PM10/21/06
to
Are you trying to find hash functions? If so, this one looks like a good
candidate, at least on the surface. For one thing, the result is
extremely sensitive to the initial value of x. With a starting value
of 0.6, the result is 0.368867. But with a starting value of
0.600001, the result is 0.65591.

Reversing it looks like it will be very hard. For example, you have

x_10 = tan(1 + x_9) % 1

which means that

x_9 = arctan(k + x_10) + m pi - 1

for some integers k and m. The fact that x_9 has to lie between 0 and 1
implies that m can only be 0 or 1. If m=0, then you need to have:

arctan(k + x_10) > 1

while if m=1 then we need:

arctan(k + x_10) < 2 - pi

There are infinitely many integers k that satisfy either inequality.

--
Daniel Mayost

In article <1161422971....@k70g2000cwa.googlegroups.com>,

James Waldby

unread,
Oct 21, 2006, 1:05:50 PM10/21/06
to
Bart Van der Donck wrote:
...

> 1. x = value between 0.0000001 and 0.9999999
> 2. x = 1 + x
> 3. x = tangent of x
> 4. x = x % 1
> 5. repeat steps 2 to 4 ten times
> 6. show new value of x
>
> Is there a way to revert this calculation ?
...

Since steps 3 and 4 are non-injective, it can't be
uniquely reverted.

Actually, the calculation isn't well-defined; for
example, at x = pi/2 - 1, ie .570796..., the result
of step 3 isn't finite.
-jiw

Bart Van der Donck

unread,
Oct 21, 2006, 1:34:00 PM10/21/06
to
James Waldby wrote:

> Bart Van der Donck wrote:
> ...
> > 1. x = value between 0.0000001 and 0.9999999
> > 2. x = 1 + x
> > 3. x = tangent of x
> > 4. x = x % 1
> > 5. repeat steps 2 to 4 ten times
> > 6. show new value of x
> >
> > Is there a way to revert this calculation ?

A unique reverse is not necessary; it would be enough that it results
in 'some' value that can be used again to perform the initial
calculation (it should serve in computer code).

> Since steps 3 and 4 are non-injective, it can't be
> uniquely reverted.
>
> Actually, the calculation isn't well-defined; for
> example, at x = pi/2 - 1, ie .570796..., the result
> of step 3 isn't finite.

I can't have PI because x is (another) calculated result from an
earlier function with character input. x is in the form "0.NS" where NS
is a finite number of digits.

Thanks again

--
Bart

0 new messages