Questions tagged [bijection]

In mathematics, a function is a bijection, or is bijective, if it is both injective and surjective.

47 questions
2
votes
1 answer

Bidirectional Dict in Julia

I have some problem where I need to define a one-to-one mapping from one variable to another. I am using a Dictionary like this: mapping = Dict('I'=>1, 'V'=>5, 'X'=>10) I also want to map it back, so at the moment I define a second…
Ricoter
  • 665
  • 5
  • 17
2
votes
1 answer

How do you efficiently compute a bijective base-k numeral (and/or its inverse) in R or any other freely-available programming language?

Although this question already has partial answers on StackOverflow, those answers are not associated with questions that have the proper name of the process / concept (bijective (base-k) numeration) in the title or among the tags. I anticipate that…
Ana Nimbus
  • 635
  • 3
  • 16
2
votes
1 answer

Is triple-CRC-32 a bad (or not) idea for generating a non-secure uniform distribution hash?

I have an input of 288 bits (comprising 4 × 32-bit identity function outputs and 10 × 16-bit integers). I need to hash this to 96 bits with as few collisions as possible. The goal could be stated as key compression with probabilistic collisions. I'm…
IamIC
  • 17,747
  • 20
  • 91
  • 154
2
votes
1 answer

Seam Session scoped component vanishes in next request

I have the Seam session-scoped component, CustomIdentity which overrides the standard Seam Identity (also session-scoped). The extended CustomIdentity has a property @Out(required=false, scope=ScopeType.SESSION)private User user In the overriden…
Markos Fragkakis
  • 7,499
  • 18
  • 65
  • 103
2
votes
2 answers

Scala test a Map is bijective

What is a simple approach to testing whether a Map[A,B] is bijective, namely for val m1 = Map( 1 -> "a", 2 -> "b") val m2 = Map( 1 -> "a", 2 -> "a") we have that m1 is bijective unlike m2.
elm
  • 20,117
  • 14
  • 67
  • 113
2
votes
1 answer

How can one find bijection from the given isomorphic graphs?

Assume that the given two multi-graphs are isomorphic. How can one find a bijection between them? I know it is hard to find isomorphism graph, since it is a NP problem. But what about if they are already isomorphic graphs? Many resources from…
proX
  • 73
  • 7
2
votes
1 answer

Bijective mapping of integers

English is not my native language: sorry for my mistakes. Thank you in advance for your answers. I'm learning C++ and I'm trying to check to what extent two sets with the same number of integers--in whatever order--are bijective. Example : int…
user3790428
2
votes
2 answers

Generating reversible permutations over a set

I want to traverse all the elements in the set Q = [0, 2^16) in a non sequential manner. To do so I need a function f(x) Q --> Q which gives the order in which the set will be sorted. for example: f(0) = 2345 f(1) = 4364 f(2) = 24 (...) To…
NeonMan
  • 623
  • 10
  • 24
1
vote
1 answer

Return set of all bijections on the input set

the method: public static Set> bijectionsFinder(Set d) say d= {1,2,3}. We are supposed to find all bijections from d -> d and return a set of those bijections. Im not sure how to start. Main method: public static void main(String...…
1
vote
2 answers

How to get combination by index from a list of unique combinations

The following is what I am trying to achieve: alpha = 'abcdefghijklmnopqrstuvwxyz0123456789' items = ['item-a','item-b'...'item-n'] my_map = defaultdict() for i, item in enumerate(items): my_map[alpha[i]] = item Here, I am creating a…
xfscrypt
  • 16
  • 5
  • 28
  • 59
1
vote
1 answer

31-bit Bijective (Perfect) Hash algorithm

What I need I need an algorithm that produces a bijective output. I have a 31-bit input and need a pseudo-random 31-bit output. What I have considered CRCs are bijective within their bit-width. I have looked on Google and can find the polynomials…
IamIC
  • 17,747
  • 20
  • 91
  • 154
1
vote
0 answers

Failed to invert twitter bijection exception in kafka spark streaming application using avro :Java

I have been following a tutorial to produce and consume messages from kafka using spark streaming. The idea is to produce simple message which are serialized in avro format. Deserialize the messages from avro format and consume using spark…
wandermonk
  • 6,856
  • 6
  • 43
  • 93
1
vote
2 answers

Bijection - Java Avro Serialization

I am looking for an example to do Bijection on Avro SpecificRecordBase object similar to a GenericRecordBase or if there is a simpler way to use the AvroSerializer class as the Kafka key and value serializer. Injection
bdparrish
  • 3,216
  • 3
  • 37
  • 58
1
vote
1 answer

Return a unique and sorted string from number

I have an input which is a number of base 10: 1, 2, 3, 52, 53 ... I would like to convert the number to a string built with the letters a to z. For each number there should be only one letter combination and they should be sorted alphabetically. 0…
Charles
  • 11,367
  • 10
  • 77
  • 114
1
vote
1 answer

Postgres: Unique reference from A to B

I want a bijection between the pair (tag1, tag2) and tag_id. CREATE TABLE tags ( question_id INTEGER NOT NULL, tag_id SERIAL NOT NULL, tag1 VARCHAR(20), tag2 VARCHAR(20), PRIMARY KEY(question_id,…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697