I made a mistake in my previous definition:
g_bitwise_over_integers(x, (a, b)) = (x & a) | b
This should be
g_bitwise_over_integers(x, (a, b)) = (x & ~a) | b
bitwise over the integers |
No, no. "f_bitwise_over_integers" is "[f bitwise] over the integers", not "f [bitwise over the integers]". I thought bitwise_f_over_integers would be harder to read.
My interpretation is that you write the integers in binary and then do bitwise operations on each binary digit? |
The set of finite sets of integers is itself countable.
to_integer({0}) = 1b
to_integer({1}) = 10b
to_integer({2}) = 100b
to_integer({10, 3}) = 10000001000b
to_integer({0, 2, 4, 6, ...}) is undefined
I gathered that & | are bitwise and and or but I am confused about ~ and ^ (are they bitwise not and bitwise xor)? |
Yes. I used the C operators because I figured that'd be clear.
What is the aim of these two functions:
f_bitwise_over_integers(x, y) = (x & ~y, y & ~x)
h_bitwise_over_integers((a,b)) = (b, a)
and how they relate to the examples you give below them? |
S1 = {1, 3, 4, 5, 7}
S2 = {2, 4, 6, 8}
P1 = x + x^3 + x^4 + x^5 + x^7
P2 = x^2 + x^4 + x^6 + x^8
N1 = 1^2 + 3^2 + 4^2 + 5^2 + 7^2 = 186
N2 = 2^2 + 4^2 + 6^2 + 8^2 = 340
(In other words, the integer representation of a set of integers is the polynomial representation with x = 2)
DN = f_bitwise_over_integers(N1, N2) = (N1 & ~N2, N2 & ~N1) = (186 & 4294966955, 340 & 4294967109) = (170, 324)
g_bitwise_over_integers(N1, DN) = (186 & ~170) | 324 = 16 | 324 = 340
g_bitwise_over_integers(N2, (324, 170)) = (340 & ~324) | 170 = 16 | 170 = 186
The negative of a set doesn't make sense |
Note that if f() applies to two subsets of S, it
cannot return a subset of S under any possible definition. It can, for example, return a pair of subsets of S.
That aside, it doesn't matter whether "the negative of a set" makes sense as a concept in itself. It only needs to make sense within the given algebraic context. If these properties hold:
* B - A = C
* A + C = B
* B + -C = A
then -- regardless of the specific identities of A, B, and C -- the corresponding definitions of addition, subtraction, and negation make sense.
For example, since rationals are in a 1-to-1 correspondence with naturals, it's possible to define rational_to_natural(q), natural_to_rational(n), rational_addition(n1, n2), rational_sign_negation(n), rational_multiplication(n1, n2), and rational_multiplicative_inverse(n), even though it's not possible to perform sign negation or multiplicative on a natural and get back a natural.
q1 = 1/2
q2 = 3/7
n1 = rational_to_natural(q1)
n2 = rational_to_natural(q2)
q3 = natural_to_rational(rational_multiplication(rational_sign_negation(n1), rational_multiplicative_inverse(n2))) = -1/2 * 7/3 = -7/6
I'm still checking against OP but I'm assuming f, g and h are the same operator or function, dare I say it. |
How could that possibly work?
* g(x, f(x, y)) = y
* g(y, h(f(x, y))) = x
* h(f(x, y)) = f(y, x)