Wikipedia:Reference desk/Archives/Mathematics/2017 May 10

From Wikipedia, the free encyclopedia
Mathematics desk
< May 9 << Apr | May | Jun >> May 11 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


May 10[edit]

Reversible Math Function[edit]

I am doing a presentation and I want to really dumb down a part of it. To do so, I need a function f(x,y) such that if you feed it a value for x and y, you get a value z. It is a one-to-one function. between y and z. If you keep x the same and change y, you will never get z for two different values of y. Now, the hard part. If I use f(x,z), I get y. It should be obvious that this is a symmetrical key encryption function. Using the key x for y, I get z. Using the key x for z, I get y. I would like something that remains in the realm of integers so the audience can perform the function on a number, like 123, and get a number, like 42. Then, they can perform the function on 42 and get 123. Finally, they can change the key and see that 123 gives 4018 and 42 gives 3317. The problem is that the only formulas that I can find that meet this criteria are far too complicated for an audience to do in a few seconds or are string functions (swapping the positions of the digits). 209.149.113.5 (talk) 13:38, 10 May 2017 (UTC)[reply]

  • Reformulation of the problem for those who prefer mathrspeak: find such that
  1. is injective
TigraanClick here to contact me 08:05, 11 May 2017 (UTC)[reply]
The function
f(x,y) = (2,000,000 - y) * something_weird(x)
seems to meet criteria.. --CiaPan (talk) 13:56, 10 May 2017 (UTC)[reply]
Thank you, but I think that I am misreading this. Assume what "something_weird(x)" just returns x. Then, if x=6 and y=123, I get (2000000-123)*6 = 11999262. So, I try it with the result. (2000000-11999262)*6 = -59995572. The goal is for the result of f(x,y) to be symmetrical - meaning that f(x,f(x,y)) = y. 209.149.113.5 (talk) 18:14, 10 May 2017 (UTC)[reply]
  • What about
which satisfies , but and . I chose this one to be near(ish) to your example, but you can make variants of a similar form,
where and are integer functions satisfying . 92.18.69.92 (talk) 19:19, 10 May 2017 (UTC)[reply]
But f(2, 4140) ≠ 123, so as I understand the question this doesn't work. Loraof (talk) 19:33, 10 May 2017 (UTC)[reply]
Ah. So if the symmetric property has to be kept for all you can get rid of the function. Like: for any integer function c(x). For a given , it's always an involution, so symmetric. But the pairs change depending on . 92.18.69.92 (talk) 20:04, 10 May 2017 (UTC)[reply]
Thank you all. While I was initially looking for a simple integer function, my wife told me that I needed to do it digit by digit to help baby-step the audience to bitwise operations. So, I took these suggestions and applied it digit by digit with, per digit: z = (2x-y)%10. For the example of x=6 and y=123, x is actually 006 (left-pad zero). z_1 = (2*6-3)%10 = 9. z_10 = (2*0-2)%10 = 8. Note, -n%10 is not the same as |-n|%10. There are two ways to handle negative mod. z_100 = (2*0-1)%10 = 9. So, z=989. Now, if I let y=989 and x=6, I should get z=123. z_1 = (2*6-9)%10 = 3. z_10 = (2*0-8)%10 = 2. z_100 = (2*0-9)%10 = 1. z=123. 209.149.113.5 (talk) 12:28, 11 May 2017 (UTC)[reply]

Numbers with a given totient number[edit]

Given n (and its factorization) is there a direct way to find the numbers, x, such that phi(x)=n? Bubba73 You talkin' to me? 16:24, 10 May 2017 (UTC)[reply]

I may have found a way - I've downloaded some papers to read... Bubba73 You talkin' to me? 16:58, 10 May 2017 (UTC)[reply]