can anyone give me a function on the integer defined as $f_n(f_n(x))=x$ please?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I need a function $f_n$ wich for all integer n is an Involution on the integer.
Put in another way I need a function $f_n$ so that $f_n(f_n(x))=x$ for all integer x and n)
ps: And wich is as much as possible is "different" when given different n since this function is supposed to be used with x corresponding to a character to encode and n a corresponding to a character of the key.
functions arithmetic integers cryptography
add a comment |Â
up vote
3
down vote
favorite
I need a function $f_n$ wich for all integer n is an Involution on the integer.
Put in another way I need a function $f_n$ so that $f_n(f_n(x))=x$ for all integer x and n)
ps: And wich is as much as possible is "different" when given different n since this function is supposed to be used with x corresponding to a character to encode and n a corresponding to a character of the key.
functions arithmetic integers cryptography
Here is a smaller example from which you can try to build larger examples: $f_n(x)=begincases n&textif~x=1\1&textif~x=n\x&textotherwiseendcases$. If you were to think of $f_n$ as a "permutation" on the integers (ignoring the requirement that permutations are ordinarily only from a finite set to itself), in the disjoint cyclic representation the only appearing cycles would be of length $2$ for every $n$. The above would be represented in disjoint cyclic representation as $(1~n)$.
– JMoravitz
Jul 19 at 15:59
actually i started by using a pseudo random algorithm to randomly shuffle the integer in the range i needed and using n as a seed but I prefer using a well defined function because storing shuffled list require a lot of memory.
– Joseph Touzet
Jul 19 at 16:14
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I need a function $f_n$ wich for all integer n is an Involution on the integer.
Put in another way I need a function $f_n$ so that $f_n(f_n(x))=x$ for all integer x and n)
ps: And wich is as much as possible is "different" when given different n since this function is supposed to be used with x corresponding to a character to encode and n a corresponding to a character of the key.
functions arithmetic integers cryptography
I need a function $f_n$ wich for all integer n is an Involution on the integer.
Put in another way I need a function $f_n$ so that $f_n(f_n(x))=x$ for all integer x and n)
ps: And wich is as much as possible is "different" when given different n since this function is supposed to be used with x corresponding to a character to encode and n a corresponding to a character of the key.
functions arithmetic integers cryptography
edited Jul 19 at 15:58
asked Jul 19 at 15:53
Joseph Touzet
184
184
Here is a smaller example from which you can try to build larger examples: $f_n(x)=begincases n&textif~x=1\1&textif~x=n\x&textotherwiseendcases$. If you were to think of $f_n$ as a "permutation" on the integers (ignoring the requirement that permutations are ordinarily only from a finite set to itself), in the disjoint cyclic representation the only appearing cycles would be of length $2$ for every $n$. The above would be represented in disjoint cyclic representation as $(1~n)$.
– JMoravitz
Jul 19 at 15:59
actually i started by using a pseudo random algorithm to randomly shuffle the integer in the range i needed and using n as a seed but I prefer using a well defined function because storing shuffled list require a lot of memory.
– Joseph Touzet
Jul 19 at 16:14
add a comment |Â
Here is a smaller example from which you can try to build larger examples: $f_n(x)=begincases n&textif~x=1\1&textif~x=n\x&textotherwiseendcases$. If you were to think of $f_n$ as a "permutation" on the integers (ignoring the requirement that permutations are ordinarily only from a finite set to itself), in the disjoint cyclic representation the only appearing cycles would be of length $2$ for every $n$. The above would be represented in disjoint cyclic representation as $(1~n)$.
– JMoravitz
Jul 19 at 15:59
actually i started by using a pseudo random algorithm to randomly shuffle the integer in the range i needed and using n as a seed but I prefer using a well defined function because storing shuffled list require a lot of memory.
– Joseph Touzet
Jul 19 at 16:14
Here is a smaller example from which you can try to build larger examples: $f_n(x)=begincases n&textif~x=1\1&textif~x=n\x&textotherwiseendcases$. If you were to think of $f_n$ as a "permutation" on the integers (ignoring the requirement that permutations are ordinarily only from a finite set to itself), in the disjoint cyclic representation the only appearing cycles would be of length $2$ for every $n$. The above would be represented in disjoint cyclic representation as $(1~n)$.
– JMoravitz
Jul 19 at 15:59
Here is a smaller example from which you can try to build larger examples: $f_n(x)=begincases n&textif~x=1\1&textif~x=n\x&textotherwiseendcases$. If you were to think of $f_n$ as a "permutation" on the integers (ignoring the requirement that permutations are ordinarily only from a finite set to itself), in the disjoint cyclic representation the only appearing cycles would be of length $2$ for every $n$. The above would be represented in disjoint cyclic representation as $(1~n)$.
– JMoravitz
Jul 19 at 15:59
actually i started by using a pseudo random algorithm to randomly shuffle the integer in the range i needed and using n as a seed but I prefer using a well defined function because storing shuffled list require a lot of memory.
– Joseph Touzet
Jul 19 at 16:14
actually i started by using a pseudo random algorithm to randomly shuffle the integer in the range i needed and using n as a seed but I prefer using a well defined function because storing shuffled list require a lot of memory.
– Joseph Touzet
Jul 19 at 16:14
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
2
down vote
accepted
A classical example is $f_n(x) = x oplus n$ where $oplus$ is the binary XOR.
oh and as it turned out the xor operator even fill a implicit condition i didn't mentioned :if i apply a function to two integer representing character and the result is greater than both integer i may have a result too big to be represented as a character and applying a modulo may broke the involutional property of the function. But in this case if i apply the xor operator to each bit represeneting two number the resulting number has to be smaller than both number. Great solution thanks ! ironicly i thinked of that first but i turned away from it since i wanted to keep my character as integer
– Joseph Touzet
Jul 19 at 17:32
add a comment |Â
up vote
1
down vote
I dont not have enough reputations to do this request like a comment
I am not sure but what do you think about $f_n(x)=(-1)^nx $
add a comment |Â
up vote
1
down vote
How about $f_n(x)$ splits the integers into intervals of length $n$ and reverses each interval, i.e.
$$
f_1(x) = 1,2,3,4,5,6,7,8,9,10,...\
f_2(x) = 2,1,4,3,6,5,8,7,10,9,...\
f_3(x) = 3,2,1,6,5,4,9,8,7,12...\
f_4(x) = 4,3,2,1,8,7,6,5,12,11,...\
f_5(x) = 5,4,3,2,1,10,9,8,7,6,...
$$
and so on.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
A classical example is $f_n(x) = x oplus n$ where $oplus$ is the binary XOR.
oh and as it turned out the xor operator even fill a implicit condition i didn't mentioned :if i apply a function to two integer representing character and the result is greater than both integer i may have a result too big to be represented as a character and applying a modulo may broke the involutional property of the function. But in this case if i apply the xor operator to each bit represeneting two number the resulting number has to be smaller than both number. Great solution thanks ! ironicly i thinked of that first but i turned away from it since i wanted to keep my character as integer
– Joseph Touzet
Jul 19 at 17:32
add a comment |Â
up vote
2
down vote
accepted
A classical example is $f_n(x) = x oplus n$ where $oplus$ is the binary XOR.
oh and as it turned out the xor operator even fill a implicit condition i didn't mentioned :if i apply a function to two integer representing character and the result is greater than both integer i may have a result too big to be represented as a character and applying a modulo may broke the involutional property of the function. But in this case if i apply the xor operator to each bit represeneting two number the resulting number has to be smaller than both number. Great solution thanks ! ironicly i thinked of that first but i turned away from it since i wanted to keep my character as integer
– Joseph Touzet
Jul 19 at 17:32
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
A classical example is $f_n(x) = x oplus n$ where $oplus$ is the binary XOR.
A classical example is $f_n(x) = x oplus n$ where $oplus$ is the binary XOR.
answered Jul 19 at 16:01
orlp
6,6051228
6,6051228
oh and as it turned out the xor operator even fill a implicit condition i didn't mentioned :if i apply a function to two integer representing character and the result is greater than both integer i may have a result too big to be represented as a character and applying a modulo may broke the involutional property of the function. But in this case if i apply the xor operator to each bit represeneting two number the resulting number has to be smaller than both number. Great solution thanks ! ironicly i thinked of that first but i turned away from it since i wanted to keep my character as integer
– Joseph Touzet
Jul 19 at 17:32
add a comment |Â
oh and as it turned out the xor operator even fill a implicit condition i didn't mentioned :if i apply a function to two integer representing character and the result is greater than both integer i may have a result too big to be represented as a character and applying a modulo may broke the involutional property of the function. But in this case if i apply the xor operator to each bit represeneting two number the resulting number has to be smaller than both number. Great solution thanks ! ironicly i thinked of that first but i turned away from it since i wanted to keep my character as integer
– Joseph Touzet
Jul 19 at 17:32
oh and as it turned out the xor operator even fill a implicit condition i didn't mentioned :if i apply a function to two integer representing character and the result is greater than both integer i may have a result too big to be represented as a character and applying a modulo may broke the involutional property of the function. But in this case if i apply the xor operator to each bit represeneting two number the resulting number has to be smaller than both number. Great solution thanks ! ironicly i thinked of that first but i turned away from it since i wanted to keep my character as integer
– Joseph Touzet
Jul 19 at 17:32
oh and as it turned out the xor operator even fill a implicit condition i didn't mentioned :if i apply a function to two integer representing character and the result is greater than both integer i may have a result too big to be represented as a character and applying a modulo may broke the involutional property of the function. But in this case if i apply the xor operator to each bit represeneting two number the resulting number has to be smaller than both number. Great solution thanks ! ironicly i thinked of that first but i turned away from it since i wanted to keep my character as integer
– Joseph Touzet
Jul 19 at 17:32
add a comment |Â
up vote
1
down vote
I dont not have enough reputations to do this request like a comment
I am not sure but what do you think about $f_n(x)=(-1)^nx $
add a comment |Â
up vote
1
down vote
I dont not have enough reputations to do this request like a comment
I am not sure but what do you think about $f_n(x)=(-1)^nx $
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I dont not have enough reputations to do this request like a comment
I am not sure but what do you think about $f_n(x)=(-1)^nx $
I dont not have enough reputations to do this request like a comment
I am not sure but what do you think about $f_n(x)=(-1)^nx $
answered Jul 19 at 16:01
Bernstein
8312
8312
add a comment |Â
add a comment |Â
up vote
1
down vote
How about $f_n(x)$ splits the integers into intervals of length $n$ and reverses each interval, i.e.
$$
f_1(x) = 1,2,3,4,5,6,7,8,9,10,...\
f_2(x) = 2,1,4,3,6,5,8,7,10,9,...\
f_3(x) = 3,2,1,6,5,4,9,8,7,12...\
f_4(x) = 4,3,2,1,8,7,6,5,12,11,...\
f_5(x) = 5,4,3,2,1,10,9,8,7,6,...
$$
and so on.
add a comment |Â
up vote
1
down vote
How about $f_n(x)$ splits the integers into intervals of length $n$ and reverses each interval, i.e.
$$
f_1(x) = 1,2,3,4,5,6,7,8,9,10,...\
f_2(x) = 2,1,4,3,6,5,8,7,10,9,...\
f_3(x) = 3,2,1,6,5,4,9,8,7,12...\
f_4(x) = 4,3,2,1,8,7,6,5,12,11,...\
f_5(x) = 5,4,3,2,1,10,9,8,7,6,...
$$
and so on.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
How about $f_n(x)$ splits the integers into intervals of length $n$ and reverses each interval, i.e.
$$
f_1(x) = 1,2,3,4,5,6,7,8,9,10,...\
f_2(x) = 2,1,4,3,6,5,8,7,10,9,...\
f_3(x) = 3,2,1,6,5,4,9,8,7,12...\
f_4(x) = 4,3,2,1,8,7,6,5,12,11,...\
f_5(x) = 5,4,3,2,1,10,9,8,7,6,...
$$
and so on.
How about $f_n(x)$ splits the integers into intervals of length $n$ and reverses each interval, i.e.
$$
f_1(x) = 1,2,3,4,5,6,7,8,9,10,...\
f_2(x) = 2,1,4,3,6,5,8,7,10,9,...\
f_3(x) = 3,2,1,6,5,4,9,8,7,12...\
f_4(x) = 4,3,2,1,8,7,6,5,12,11,...\
f_5(x) = 5,4,3,2,1,10,9,8,7,6,...
$$
and so on.
answered Jul 19 at 16:02
Dark Malthorp
777212
777212
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2856769%2fcan-anyone-give-me-a-function-on-the-integer-defined-as-f-nf-nx-x-plea%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Here is a smaller example from which you can try to build larger examples: $f_n(x)=begincases n&textif~x=1\1&textif~x=n\x&textotherwiseendcases$. If you were to think of $f_n$ as a "permutation" on the integers (ignoring the requirement that permutations are ordinarily only from a finite set to itself), in the disjoint cyclic representation the only appearing cycles would be of length $2$ for every $n$. The above would be represented in disjoint cyclic representation as $(1~n)$.
– JMoravitz
Jul 19 at 15:59
actually i started by using a pseudo random algorithm to randomly shuffle the integer in the range i needed and using n as a seed but I prefer using a well defined function because storing shuffled list require a lot of memory.
– Joseph Touzet
Jul 19 at 16:14