A list of puns related to "Bijective"
Converting from decimal to a bijective number system with some base. It helps me to think about it like this...
Digits in number | max numbers that can be stored (in this case base 26)
0 +1 (empty string)
1 +26
2 +26*26
3 +26*26*26
4 +26*26*26*26
You can do it without the nice equations, but a bunch of math stuff later you get...
function toBijectiveNumber(number = 0, digitSet = 'abcdefghijklmnopqrstuvwxyz')
{
let digits = Math.floor(Math.log((digitSet.length - 1) * number + 1) / Math.log(digitSet.length));
let offset = (Math.pow(digitSet.length, digits) - 1) / (digitSet.length - 1);
number -= offset;
This basically subtracts all the extra numbers from previous digits and just leaves the 26*26*26*26 for a number that needs 4 digits for example. Then it's just like converting a number to another base...
let str = '';
for(let i = 0; i < digits; i++)
{
str += digitSet[number % digitSet.length];
number = Math.floor(number / digitSet.length);
}
return str;
}
This works, but then I also found this piece of code, which does it much simpler, but I can't figure out why it works...
function toBijectiveNumber(number = 0, digitSet = 'abcdefghijklmnopqrstuvwxyz')
{
let str = '';
for(;;)
{
number--;
str += digitSet[number % digitSet.length];
if(number < digitSet.length) break;
number = Math.floor(number / digitSet.length);
}
return str;
}
Why does it work? It seems like it should get a different result.
https://imgur.com/a/CAiN8Me
If we construct a bijective map from (a,b) to (-1,1) then we have our answer. I did the following: let f(a) = -1 and f(b) = 1 then found a slope m = f(b) - f(a) / b - a = 2 / b - a then using the fact that f(a) = -1 we have f(x) - f(a) = (2 / b - a)(x - a) f(x) = (2 / b - a)(x - a) + f(a)
f(x) = (2 / b - a)(x - a) - 1
f is bijective from (a,b) to (-1,1) where a not equal to b. We can rule out a = b since if that were the case then (a,b) = (a,a) cannot be mapped to R.
I would like to know if this line of reasoning works
Edit: I am realizing now that with f we are mapping [a,b] onto [-1,1] from that can we still conclude that (a,b) maps to (-1,1)? Can't we just restrict the domain and consider (a,b) subset of [a,b]?
Hi, I think it is worthwhile to give some context to this question. This is being done in Meteor/Apollo/MongoDB/React, but the question is language-agnostic.
I'm trying to create an endless feed of random user posts without repeats. This is typically done with pagination, but the issue with pagination is that it is returned in a fixed order as it appears in the database. What I am trying to achieve is random pagination.
So if I have say 100 entries in my database, my current big picture idea is that I generate a random seed on the client upon page load, and send that seed back and forth for pagination, and to have a function which takes in this seed to bijectively map to an entry in the database.
Here I will illustrate an example. Suppose my database has 1,000 queries (numbered & indexed 1 - 1000 for simplicity). Client A sends seed A along with the offset (0) and limit (10). The limit here will always be constant at 10, and the offset is the only changing value, which is the sum of all previous limits.
Now, what should happen is I obtain 10 random unique integers in the range [1,1000], based on the seed, offset, and limit. So with typical pagination, I will retrieve the data from indices 1 to 10. But now with this seed, I need to injectively map the numbers [1,10] to a random unique selection of 10 integers within the range [1,1000].
Next, I retrieve the data at those specific indices in the DB, and send it back to client A. Now, client A scrolls down and hits the trigger to load more, so now client A sends seed A along with an offset (10) and limit (10). With the offset and limit, I have the new unseeded range, [11,20]. And this should map to a random unique selection of 10 integers within the range [1,1000] but NOT map to the integers already mapped to by the first 1-10. This means that I need to have a random bijective mapping between the ranges [1,1000] and [1,1000].
This looked like it could be solved with the Fisher-Yates shuffle which would basically give me a random permutation, and then I can predictably do this with a seeded Fisher-Yates shuffle. But it's not quite the case because I wish to avoid having to generate this array of [1,1000] on every user query. The range scales based on the number of items and once this number grows large (potentially in the millions, or more), it isn't
... keep reading on reddit β‘Hi guys.. Question in title.
I get the first part:
[[[Suppose f: X -> Y has an inverse function f^-1: Y -> X,
Prove f is surjective by showing range(f) = Y:
for any y in Y, there is some x = f^-1(y) such that f(x) = y. Hence, range(f) = Y.
Prove f is injective. Suppose x_1 and x_2 such that f(x_1) = f(x_2)
Since f^-1 exists: x_1 = f^-1(f(x_1)) = f^-1(f(x_2)) = x_2. Hence it is injective.
Hence, f is both surjective and injective, so it is bijective. ]]]
I've NO CLUE how to do the second half of the proof where I suppose f: X -> Y is a bijection and to prove it has an inverse function. Bit lost... Please help!
Sorry for no LaTeX. not sure how to put it into reddit
What would decimals look like in bijective base 10 numeration? Is it possible?
Bijective numeration is any numeral system in which every non-negative integer can be represented in exactly one way using a finite string of digits. Instead of using digits 0-9, you would use digits 1-A and never use a zero.
I was wondering if thereβs a formula for the inverse of Cantor bijective mapping function for n-tuple inputs, I know thereβs an inverse for n=2 and that the Cantor function is invertible for any number of inputs. What do you think? Is there such an inverse function?
1 2 3 4 5 6 7 8 9 X 11 12 13 14 15 16 17 18 19 1X
Get is at 7X, or -7X
let's say that f is a function witch takes elements form A = {1,2,3,4,5} to B = {a,b,c,d,e} in this way 1->a, 2->b, 3->c, 4->e, 5->d. In this case f is a bijective function.
Ok, for a function to be bijective it needs to be injective and surjective.
An injective function means that whatever values it maps from A to B, you can not map multiple values from A to a single one from B (for example: 1->a, 2->a breaks the rule for infectivity)
A surjective function needs to cover all the element form B, so if A = {1,2,3,4,5} to B = {a,b,c,d,e,f} in and 1->a, 2->b, 3->c, 4->e, 5->d, f in not surjective because it doesn't map anything onto element f.
So f:N->N where f(x)=x+1 is not bijective because you can not get f(x)=0 which means it is not surjective
but f:N->N^(*) f(x)=x+1 is bijective.
Does this seem right?
Counting with rocks, papers, and scissors in the bijective base 3 numeral system. Here's how to count in bijective base 3:
1, 2, 3, 11, 12, 13, 21, 22, 23, 31, 32, 33, 111, 112, 113, 121, 122, ...
1: Rock
2: Paper
3: Scissors
The first get is at Rock Rock Rock Rock Rock Rock Rock (decimal 1093).
Or are there examples where you can prove that the existing bijections are all uncomputable?
Is a function still surjective, if there exists an Y thats not matched to f(x)? What kind of function is a sine?
Edit: spelling
my understanding:
I only know this, but I dont know the meaning/defintion of these 3 things!
For f to be invertible it must be bijective.
Can we construct some kind of "trijective" function so that
Is it possible at all?
The -1
superscript might be inaccurate here.
Suppose this graph
https://en.wikipedia.org/wiki/File:Inverse_Function_Graph.png
by inverse f
we are flipping the function by the dotted line y = x
, at 180Β°. Can we flip it 120Β° at a time? So after 3 times it will be restored to the original function f
. How do we calculate the intermediate g
as the 120Β° flipped version of f
?
Edit1: bijective/trijective is misleading. Please ignore the wording. I mean the steps it takes to restore to the original function.
Also how to find if a particular function is injective or bijective?
Looking at the definition of homeomorphism on wikipedia:
>A function f:X -> Y between two topological spaces is a homeomorphism if it has the following properties:
>
>- f is a bijection (one-to-one and onto),
>
>- f is continuous,
>
>- the inverse function f^(-1) is continuous (f is an open mapping).
Is it possible to have a function that is a bijection and continuous, but the inverse is not continuous? Can you give an example?
Thanks!
What a freak of a system!
Bijective- No Zero, there is a digit for the base though (123456789X, 11)
Balanced- Half positive, half negative digits (1234514Μ 13Μ 12Μ 1T10)
Little Endian- Numbers are left to right instead (123456789, 01, 11, 21, 31, 41, 51, 61, 71, 81, 91, 02, 12, 22, 32, 42, 52)
Bijective Balanced Little Endian: (12345, 4Μ 1, 3Μ 1, 2Μ 1, T1, X, 11, 21, 31, 41, 51, 4Μ 2, 3Μ 2, 2Μ 2, T2, X1, 12
Start at 1, get is at XXT1 (I think 1,000 decimal)
Continued from here
Thanks to /u/piyushsharma301 for the run and assist
> A bijective numeral system is one where every combination of digits represents an original number. Standard numeral systems aren't, because leading zeroes have no effect on the value. See the wiki page here
> In bijective base 10, there is no digit for 0, and the digit "A" represents ten
Get is at 199A
Setting: I have a convolution of Image I and kernel w, J=conv2D(I,w). I is an image I of size nxn with c channels, while w is a cxcx3x3 matrix, therefore we have c 3x3 filters that can be applied to the image. We use zero-padding so that J has the same dimensionality of I.
What properties does w have to fulfill for the convolution to be invertible? It is clear that at least one such w exists, because 1x1 convolutions are a subset of 3x3 convolutions and since we have c filters, we can encode the identity, which is invertible. It is not enough for the filters to be independent, because as the input has 9c dimensions, we can still loose information.
I am struggling to find a function that goes between set A and set B. Can someone help me?
The problem:
Give a bijective proof: The number of n-digit binary numbers with exactly k ones equals the number of k-subsets of [n].
While base integer is boring, the bijective base integer is quite funny.
Base integer means the place values are ... 6 5 4 3 2 1. The number 5 would be represented as 10000. But a bijective base does not allow zeros. So the way to count in bijective base integer is this:
base 10 | bijective base integer |
---|---|
1 | 1 |
2 | 2 |
3 | 11 |
4 | 12 |
5 | 21 |
6 | 111 |
7 | 112 |
8 | 121 |
9 | 211 |
10 | 1111 |
As you can see there is at most only one 2 and it moves to the front, when it reaches the front we add a new place to the next number.
Get is at [499 ones in a row] 12111111111111111111111111111111111111111111 (took me a while to figure it out).
A bijective numeral system is one where every combination of digits represents an original number. Standard numeral systems aren't, because leading zeroes have no effect on the value. See the wiki page here: https://en.wikipedia.org/wiki/Bijective_numeration
In bijective base 10, there is no digit for 0, and the digit "A" represents ten. So:
Decimal | Bijective base 10 |
---|---|
1 | 1 |
2 | 2 |
3 | 3 |
9 | 9 |
10 | A |
11 | 11 |
12 | 12 |
99 | 99 |
100 | 9A |
101 | A1 |
110 | AA |
Get is at 99A
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.