# Got math?

Discussion in 'BlackHat Lounge' started by JustUs, Mar 9, 2016.

1. ### JustUsPower Member

Joined:
May 6, 2012
Messages:
626
587
I am sitting here listening to shoplifting music while waiting for the Go game between Googles Deep Mind and Go champion Lee Sedol to begin. In the meantime, I am thinking about how to solve a problem converting between different base ten numbers and keeping the numbers as integers after the conversion rather than as fractional numbers.

Say I want to from a number set that only has 59 numbers to a number set that has 69 numbers. You would think the problem to be fairly easy and straight forward. It is not. To start, the conversion would begin n * 69/59 - where n represents the number you want to convert from the 59 set to the 69 set. However, the solution is not so straight forward. Some numbers you could round off. You run into problems simply rounding off. As examples:
A: 14 * 69/59 = 16.372881355932203389830508474576
B: 15 * 69/59 = 17.542372881355932203389830508475

'A' would be rounded off to 16 while 'B' would be rounded off to 18. This solution would under represent 17: Here is a graph that illustrates this problem:

Well, we can toss that problem out the door. Well what about truncating the numbers. This also creates a problem - even though I do not have an example handy.

This graph shows the problem with other numbers being under and over represented:

For the data I am using, I have to have discrete integers after the conversion process. So back to the numbers.
A: 14 * 69/59 = 16.372881355932203389830508474576

I am viewing the mantissa (the decimal part) as an error percentage. 37 percent of the time the number will belong to either the rounded number or the truncated number. The remainder of the time the number will belong to the other group. However this representation is also probably wrong.

Does anyone have an idea as to how I can convert from the 59 number set to the 69 number set with a minimal error?

• Thanks x 1

Joined:
Nov 1, 2012
Messages:
1,053
652
Occupation:
404
Location:
Undisclosed
....wut?

/15char

Joined:
Sep 29, 2012
Messages:
1,672
463
Occupation:
marketer
Location:
Hell

4. ### redarrowElite Member

Joined:
Apr 1, 2013
Messages:
6,787
1,667
Can nit be dobe you 10 numbers in front .

69over 59 dont fit .

No matter how u do it even in dec

5. ### GroundUpRegular Member

Joined:
Jan 1, 2015
Messages:
333
305
Is this connected to a lottery where they've increased the balls from 59 to 69.

Also what is 'shoplifting music'?

6. ### JustUsPower Member

Joined:
May 6, 2012
Messages:
626
587
Shoplifting music is the music that a store plays while you shop. It is so bad, boring, and repetitive that you want to steal everything in the store.

This is connected to a number of machine learning methods where you discrete objects. You cannot have 1.5 alive cats, or 2.34 whole bottles of E-juice for a vaporizer (E-cig). It is also closely connected to 'Discrete Mathematics' used in computer science.

In my situation, I am using it for a starting point attempting to apply the math to serp position. I cannot have a link that rates at position 14.37.

Last edited: Mar 9, 2016
7. ### CherrySupreme Member

Joined:
Mar 23, 2014
Messages:
1,259
324
Gender:
Female
Location:
Care-a-Lot
I regret looking at this thread! It gave me a massive headache! lol

8. ### GroundUpRegular Member

Joined:
Jan 1, 2015
Messages:
333
305
Haha very good. I'm a pure mathematics man so I'll have to bow out and go learn discrete mathematics.

9. ### jazzcModeratorStaff MemberModeratorJr. VIP

Joined:
Jan 27, 2009
Messages:
2,739
11,870
Occupation:
Potentate
Location:
Asuncion
Yes, it is. It's called interpolation and it's arbitrary (i.e. there are many strategies to use and which one you will depends on what you are trying to best fit your data for). For example, you could do an spline interpolation and then "split" it in 69 equally distanced points.

10. ### towelfoxJunior Member

Joined:
Jan 11, 2012
Messages:
183
63
I don't need this in my life. Sometimes I don't even like simple multiplication and division. Fuck this.

11. ### qrazySenior Member

Joined:
Mar 19, 2012
Messages:
1,115
1,725
Location:
Banana Republic
I don't think you'll be able to get accurate results when you round off , truncate or do any math with an Integer that results in data loss. For e.g if you round off, the error will be always between 0 to 1, because you'll never know if it was rounded because of the decimal part being greater than 0.5 or less than 0.5, but what you will have is just an rounder integer.

May be you can store the these values as bits, instead of Integers and use your own bit converter to get the original values before using them to plot.

12. ### JustUsPower Member

Joined:
May 6, 2012
Messages:
626
587
I was hoping you would show up. At least you have given me an idea. I had already looked at logarithmic interpolation, and it also failed. I have currently attempted many different methods, all with unacceptable results.

I ended up resorting to telephone most of the research staff at the University of Utah. None of them had any idea either. My uncle has a PHd in mathematics. Emailed him. He has no idea. Finally started telephoning the research CS staff at the U of U. None of them have any idea either. One of the CS staff suggested that I contact Dr. Dongbin at the U because this stuff is right up his alley (Scientific Computing, Discrete math, yada). Waiting on email from him.

If you have other ideas on solving this, please throw them out.

13. ### NobelNerdPower Member

Joined:
Feb 21, 2013
Messages:
786
349
Occupation:
Digital Marketing
Location:
India
Yes You right very good I understand it clearly (NOT).....Can you ELI5 this? only part i understand is the go thing between google AI and the go champion...

14. ### JustUsPower Member

Joined:
May 6, 2012
Messages:
626
587
You may be right and I may be crazy. When I first started on this problem, I began looking into weather models where some of these problems occasionally come up. Because of what I read, I began storing the mantissa as a 128 digit number so that if I ever find a solution it will be reproducible.

15. ### qrazySenior Member

Joined:
Mar 19, 2012
Messages:
1,115
1,725
Location:
Banana Republic
If storing the value is an issue, you can convert them to string. I assume you're using .NET, Just use the DoubleConverter class to convert it to exact string used in the article.

16. ### jazzcModeratorStaff MemberModeratorJr. VIP

Joined:
Jan 27, 2009
Messages:
2,739
11,870
Occupation:
Potentate
Location:
Asuncion
The thing you should understand here is that interpolation is an arbitrary process. I'm repeating this because it's important. There is no limit to what kind of interpolation you may do. So the key here is "what do you want the interpolation to produce?". When you say "with a minimal error" it means nothing because there is no single correct answer as it is put (there are infinite), so there can not be a measurement of error to be minimized.

So, to get out of this loop, you need to define first what exact characteristics the outcome should abide by. Only then can you constuct the "right" interpolation method (assuming the requirements allow at least one feasible to exist).

17. ### Asif WILSON KhanExecutive VIPJr. VIP

Joined:
Nov 10, 2012
Messages:
13,237
36,502
Gender:
Male
Occupation:
Fun Lovin' Criminal
Location:
London
Damn I thought this was the boobies thread, I'm outta here

• Thanks x 2
18. ### JustUsPower Member

Joined:
May 6, 2012
Messages:
626
587
In this case, and because I have about 35,000 data points, correct is having the points all clustered within a standard deviation of the average while maintaining the numbers as integers.

Joined:
Mar 19, 2012
Messages:
1,115