Article View: aus.mathematics
Article #36Re: How to find a formula from a list of numbers
From: Adam Nielsen
Date: Sun, 04 Oct 2009 22:25
Date: Sun, 04 Oct 2009 22:25
65 lines
2973 bytes
2973 bytes
>>> A | B
>>> -----+-----
>>> 0 | 0
>>> 32 | 3.6
>>> 64 | 7.6
>>> 128 | 15.6
>>> 255 | 31.5
>>>
>>> And I need a formula such that I can put in any number (between 0 and 255
>>> inclusive) for A, and obtain the result B. Unfortunately because this isn't
>>> quite straightforward division I'm a bit stuck.
>>>
> Inspecting the results, the differences in the successive B values for
> the successive doublings of the A values are: 4, 8, 16 (actually 15.9
> for slightly less than a doubling). So, a simplified formula is:
> B = A/8 - 0.4
>
> This would produce a negative B value for A < 4, so a correct formula is:
> B = {A/8 - 0.4 if A >=4, 0 otherwise}
>
> There may need to be some additional tweaking for small values of A,
> which we don't yet have the measurements for.
Thanks Barb, that's excellent! I've collected some extra values and it looks
like you're spot on:
A | B
-----+-----
0 | 0
3 | 0
4 | 0.1
6 | 0.3
8 | 0.6
16 | 1.6
32 | 3.6
64 | 7.6
128 | 15.6
192 | 23.6
255 | 31.5
The simple divide and subtract will also keep the code nice and fast. However
I'm not so sure one of the other rails will be that easy:
A | B'
-----+-----
0 | 0
1 | 0.1
4 | 0.4
8 | 0.9
16 | 1.9
32 | 3.8
48 | 5.7
64 | 7.6
96 | 11.4
128 | 15.2
160 | 19.1
192 | 22.9
208 | 24.8
224 | 26.7
255 | 30.4
Many thanks for your help!
Cheers,
Adam.
Technical Details
Message-ID:
<FtadnaK-YsVEvVTXnZ2dnUVZ_oKdnZ2d@westnet.com.au>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mailReferences:
<JOqdnbc8ud5gPFXXnZ2dnUVZ_v6dnZ2d@westnet.com.au> <ik9hc59at0uhkd54jr78j3ba55a8j7cesm@4ax.com> <see-3529E1.08572405102009@mail.eternal-september.org>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail NNTP-Posting-Date: Sun, 04 Oct 2009 17:25:28 -0500 Date: Mon, 05 Oct 2009 08:25:27 +1000 From: Adam Nielsen <a.nielsen@remove.this.shikadi.net> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.8.1.22) Gecko/20090809 Thunderbird/2.0.0.22 Mnenhy/0.7.5.0 MIME-Version: 1.0 Newsgroups: aus.mathematics Subject: Re: How to find a formula from a list of numbers References: <JOqdnbc8ud5gPFXXnZ2dnUVZ_v6dnZ2d@westnet.com.au> <ik9hc59at0uhkd54jr78j3ba55a8j7cesm@4ax.com> <see-3529E1.08572405102009@mail.eternal-september.org> In-Reply-To: <see-3529E1.08572405102009@mail.eternal-september.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Message-ID: <FtadnaK-YsVEvVTXnZ2dnUVZ_oKdnZ2d@westnet.com.au> Lines: 65 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 203.217.41.238 X-Trace: sv3-BXypGky45p2PzY6UKno2iMkBnpj18xCn1J2Tw+6R7jBk4Ca2eapB+nGP5zBK3scyIYlVPquKb43Qxk0!3LgtNWbcQYfqk0DPlKLRUVoKNXZl6Rb0MIVP0hB5/wWWZ16fGJ0NZrgnI/NuTU3mOs/nrpFDg8V+!U6HxcNMHIA7gSJYtBnDD9A== X-Complaints-To: abuse@westnet.com.au X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40