Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Possibly this is a very lame question for this site.

There is a function $f(n)=-\ln(a*n); \space \Bbb Z \to \Bbb R$, and I want to define $a$ for pairs of values. For example:

$f_1(n_1)=15; f_1(n_5)=1.157$

$f_2(n_1)=454; f_2(n_8)=1.0042$

and so on. How can I write a function that could calculate $a$ values from the starting values?

share|improve this question
    
What are $n_1$, $n_5$, and $n_8$? Or what do you know about them, other than that they are the first, fifth, and eighth elements of a sequence? (I'm assuming) –  David Z Sep 17 '12 at 20:09
add comment

1 Answer

up vote 4 down vote accepted

I guess you want something like this, but not sure:

Solve[{-Log[a n] == x1, -Log[a (n + k)] == x2}, {a, n}]
(*
  a -> (-E^-x1 + E^-x2)/k
*)

Edit

More generally, for any invertible function f:

Solve[{f[a n] == x1, f[a (n + k)] == x2}, {a, n}]

$\left\{\left\{a\to \frac{f^{(-1)}(\text{x2})-f^{(-1)}(\text{x1})}{k},n\to -\frac{k f^{(-1)}(\text{x1})}{f^{(-1)}(\text{x1})-f^{(-1)}(\text{x2})}\right\}\right\}$

share|improve this answer
1  
+1 for a good guess (I was completely mystified, but this looks plausible). –  Oleksandr R. Sep 17 '12 at 20:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.