Questions tagged [inverse]

In mathematics, a function y=f(x) tells us how to map input x to output y. Inverting a function (or an operator) is attempting to find a function f¯¹ that maps y to x, such that x=f¯¹(f(x)).

In mathematics, a function y = f(x) tells us how to map input x to output y. Inverting a function (or an operator) is attempting to find a function f -1 that maps y to x, such that x = f -1( f(x) ).

It is not always possible to find the inverse map, and sometimes it does not even exist.

One of the most common inverse problems is inverting an n × n matrix: only square matrices A with det(A) ≠ 0 have an inverse matrix A-1. See .

474 questions
163
votes
4 answers

What is inverse function to XOR?

There is XOR function in Java - a^b For exemple: 5^3 = 6 Can you tell me inverse function? If I have 6 and 3 can i get range of numbers which include number 5?
A.N.R.I
  • 1,931
  • 2
  • 15
  • 20
70
votes
3 answers

When to use inverse=false on NHibernate / Hibernate OneToMany relationships?

I have been trying to get to grips with Hibernate's inverse attribute, and it seems to be just one of those things that is conceptually difficult. The gist that I get is that when you have a parent entity (e.g. Parent) that has a collection of…
James Allen
  • 6,406
  • 8
  • 50
  • 83
51
votes
3 answers

Is there a regex to match a string that contains A but does not contain B

My problem is that I want to check the browserstring with pure regex. Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13 Should match Mozilla/5.0 (Linux; U; Android 2.2.1;…
user1061688
  • 511
  • 1
  • 4
  • 3
47
votes
3 answers

What is the difference between cascade & inverse in hibernate, what are they used for?

How to use cascade and inverse in hibernate? What is the procedure/tag to define them? Are they related to each other and how are they useful?
Chandra Sekhar
  • 16,256
  • 10
  • 67
  • 90
42
votes
5 answers

What's the most concise way to get the inverse of a Java boolean value?

If you have a boolean variable: boolean myBool = true; I could get the inverse of this with an if/else clause: if (myBool == true) myBool = false; else myBool = true; Is there a more concise way to do this?
faq
  • 757
  • 2
  • 8
  • 9
39
votes
8 answers

Matrix inversion without Numpy

I want to invert a matrix without using numpy.linalg.inv. The reason is that I am using Numba to speed up the code, but numpy.linalg.inv is not supported, so I am wondering if I can invert a matrix with 'classic' Python code. With numpy.linalg.inv…
34
votes
5 answers

Reverse Box-Cox transformation

I am using SciPy's boxcox function to perform a Box-Cox transformation on a continuous variable. from scipy.stats import boxcox import numpy as np y = np.random.random(100) y_box, lambda_ = ss.boxcox(y + 1) # Add 1 to be able to transform 0…
Gyan Veda
  • 6,309
  • 11
  • 41
  • 66
29
votes
5 answers

Is it possible to invert an array with constant extra space?

Let's say I have an array A with n unique elements on the range [0, n). In other words, I have a permutation of the integers [0, n). Is possible to transform A into B using O(1) extra space (AKA in-place) such that B[A[i]] = i? For example: A…
orlp
  • 112,504
  • 36
  • 218
  • 315
27
votes
10 answers

How to get inverse color from UIColor?

e.g. The inverse color from black should be white.
Míng
  • 2,500
  • 6
  • 32
  • 48
27
votes
3 answers

inverse=true in JPA annotations

In my application I use JPA 2.0 with Hibernate as the persistence provider. I have a one-to-many relationship between two entities (using a @JoinColumn and not @JoinTable). I wanted to know how could I specify inverse=true (as specified in hbm.xml)…
Andy Dufresne
  • 6,022
  • 7
  • 63
  • 113
25
votes
2 answers

Solving for the inverse of a function in R

Is there any way for R to solve for the inverse of a given single variable function? The motivation is for me to later tell R to use a vector of values as inputs of the inverse function so that it can spit out the inverse function values. For…
crazian
  • 649
  • 4
  • 12
  • 24
23
votes
6 answers

Compile-time map and inverse map values

Can someone recommend a more elegant way to achieve these compile-time constants? template struct Map; template <> struct Map<0> {static const int value = 4;}; template <> struct Map<1> {static const int value = 8;}; template <> struct Map<2>…
prestokeys
  • 4,817
  • 3
  • 20
  • 43
16
votes
2 answers

notepad++ Inverse Regex replace (all but string)

I essentially wish to match every line that DOES NOT contain this string "Hello" Example: sdfsdoifdoskf fdgokfdghodfkg hello fdojgohdfgjkdfg gfobjobhkdfokgdfg dofjkdsf hello dfgkdfogdfg xcvmxhckvmxck fogkdfhokg hello I attempted this Regex pattern…
user1064906
  • 161
  • 1
  • 1
  • 4
16
votes
1 answer

What's the common name for the inverse of the lerp function?

The function lerp() is a common function in programming languages: lerp(a, b, t) = a + t * (b - a). Now for very many situatons I have an inverse function: fraction(x, a, b) = (x - a) / (b - a). This function is built so that lerp(a, b,…
16
votes
3 answers

The reverse/inverse of the normal distribution function in R

To plot a normal distribution curve in R we can use: (x = seq(-4,4, length=100)) y = dnorm(x) plot(x, y) If dnorm calculates y as a function of x, does R have a function that calculates x as a function of y? If not what is the best way to…
geotheory
  • 22,624
  • 29
  • 119
  • 196
1
2 3
31 32