# [OT] Weighted distribution of Numbers

dsc at swcp.com dsc at swcp.com
Sun Aug 4 18:00:42 EDT 2019

```I'm unsure how often 800 or so changes. I'll call it 800, it is just a name. Values can range from 0 through 800.

You can map a number in that range to 0-1 by dividing by 800. That is, scaled1(n) is n/800.

I guess you want to map each number n in that into one of 101 bins, 0 through 100.
Perhaps something like this: trunc( 100.9 * scaled(n) )

However you want to tweak at the top, so this might become trunc( 100.9 * tweak( scaled(n) ) )

The function tweak takes a number from 0 to 1 and returns a number from 0 to 1 where
tweak(0) = 0
tweak(1) = 1
if x >= y then tweak(x) >= tweak(y)

A straight line fits that but that isn't what you want.

Here are some definitions for tweak() you might try:
x [that straight line]
2*x/(1+x)
sin(x * pi/2)
some other sine thing that is symmetrical
piecewise linear
1- sqrt( 1-x )
min( 1, 1.03*x) [special case of piecewise]

However, if you want tweaking to depend on the entire dataset, then there is more work.

> On Aug 4, 2019, at 3:09 PM, Dar Scott Consulting via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Oh, good. I was worrying that you might have a bad customer.
>
>> On Aug 4, 2019, at 3:05 PM, Ralph DiMola via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>>
>> I'm not plotting this but using it for searching.
>>
>> I'm not really lying. I'm trying to come up with the raw numbers from many
>> individual components. It's like "Gone with the Wind" and "Apocalypse Now"
>> both getting 100 on Rotten Tomatoes. But if you looked under the hood and
>> added up components such as sound, costumes, artwork, casting... and applied
>> a weight to each then "Apocalypse Now" might get a raw rating of 800 and
>> "Gone with the Wind" get a 790. But they are both so close to the top I
>> would want them to both get 100. I can do this via the "human factor" by
>> manually adjusting some of the results(mostly at the top) but I would like
>> to somewhat automate it so when the components change I will do a
>> re-calculation run and say the top number goes up by 25 all the manual
>> adjustments go out the window. I want this to be somewhat automated.
>>
>> Ralph DiMola
>> IT Director
>> Evergreen Information Services
>> rdimola at evergreeninfo.net
>>
>>
>> -----Original Message-----
>> From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf
>> Of Dar Scott Consulting via use-livecode
>> Sent: Sunday, August 04, 2019 4:33 PM
>> To: How to use LiveCode
>> Cc: Dar Scott Consulting
>> Subject: Re: [OT] Weighted distribution of Numbers
>>
>> I was thinking the same, but was to afraid to say it. Yes, the actual name
>> is "lying".
>>
>> However, there might be an honest attempt to display crowded dots or icons.
>>
>>> On Aug 4, 2019, at 2:19 PM, hh via use-livecode
>> <use-livecode at lists.runrev.com> wrote:
>>>
>>>> Ralph D. wrote:
>>>> I'm sure there's an actual name for doing this in the statistician's
>>>> world but I don't know what it is.
>>>
>>> This has nothing to do with "statistics".
>>> This is simply "try to lie by data cheating".
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

```