Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.independent

Topic: Help with formula (revised question)
Replies: 7   Last Post: Nov 20, 2013 8:15 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Barry Schwarz

Posts: 71
Registered: 3/13/08
Re: Help with formula (revised question)
Posted: Nov 20, 2013 3:16 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Wed, 20 Nov 2013 00:50:59 -0700, "Robert Crandal"
<noreply2me@yahoo.com> wrote:

>I asked a similar question earlier. Thank you
>everyone who tried helping. However, I'd now
>like to revise the data and requirements.
>Here is the new data set:
>
>X Y
>-- --
>0.0 1
>0.1 1
>0.5 1
>0.9 1
>1.0 1
>1.03 2
>1.5 2
>1.8 2
>2.0 2
>2.3 3
>3.0 3
>3.2 4
>
>X is a positive real number greater than or equal
>to zero (or 0.0). Y is an integer as seen in the
>second column above.
>
>Can this data be represented with a formula
>that only uses either addition, subtraction,
>multiplication, division, modulus, or the power (^)
>function, or any combination of these?
>
>The function f(x) = x + (0^x) almost works, but
>it needs a little bit of tweaking.
>
>If possible, I would like to avoid using any
>abs() value functions, or max() functions, or
>"if-else" programming logic, or roundup() functions.
>I'm curious if I can find a formula that only
>uses basic math operators.
>
>I'd appreciate any ideas. Thank you!


I don't know if this is the same as the reference Peter provided but I
learned this in high school as a rebuttal to those inane IQ test
questions about the next number in sequence. It works for any finite
number of real X and Y values.

If there are N sets of X-Y values, the polynomial consists of the sum
of N terms, each term being a polynomial of degree N-1. The i-th term
is the product of a quotient and a constant. The numerator of the
quotient is formed as the product of factors each having the form
X-X(j) where j goes from 1 to N but omits i. The denominator of the
quotient is formed as the product of factors each having the form
X(i)-X(j) for the same j. The constant this quotient is multiplied by
is Y(i).

If you evaluate this polynomial at X(k), every term goes to zero,
because the numerator contains the expression X-X(k), except the k-th
term. In the k-th term, the numerator and denominator evaluate to the
same value so the quotient is 1 and the product is simply Y(k) as
desired.

Here is a sample using just the X values of 0.0, 0.9, 1.5, and 3.2
from your data. It is probably best viewed in monospaced font.

(x-0.9)(x-1.5)(x-3.2)
y = ---------------------- * 1
(-0.9)(-1.5)(-3.2)

(x)(x-1.5)(x-3.2)
+ ------------------ * 1
(0.9)(-0.6)(-2.3)

(x)(x-0.9)(x-3.2)
+ ------------------ * 2
(1.5)(0.6)(-1.7)

(x)(x-0.9)(x-1.5)
+ ------------------ * 4
(3.2)(2.3)(1.7)

You should have no trouble expanding this for the 12 values you
provided.

--
Remove del for email



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.