Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8756199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:01:05+00:00 2026-06-13T14:01:05+00:00

I am looking for a mathematical formula (or logical/java programmatic method, but preferably raw

  • 0

I am looking for a mathematical formula (or logical/java programmatic method, but preferably raw mathematical) that will take a given, unique, series of numbers and linearize them.

EG: 1,2,4,7,10 ==> 0,1,2,3,4.

  • The linearized order must represent least to greatest such that using the same example numbers {0=1,1=2,2=4,3=7,4=10}, 10,2,7,4,1 ==> 4,1,3,2,0 with the same association to original values.
  • The numbers will range from constants in the range [n,m] and there will be c numbers.
  • n and m can be any positive numbers > 0, but m>n. and m-n != c.

This is being used with java to take a string of unique IDs associated with a constructor and order them 0,1,2,3,4 so that they can be assigned into a sorted array without actually sorting and just by deriving their base number and performing error checking to avoid filling an element twice or leaving a blank space.

This is being used to provide a “best guess” as to the location of these unique numbers in an array of size n. In doing this, I hope to achieve a more robust sorting algorithm that processes in a fraction of the time since it doesn’t require actually going through the array more than once (max and min being determined when the array is initially populated).

By request, additional input/output:

int n=1350,m=1500,c=5;
/**
* Note that the items in output are the results,
*respective to element, of the mathematical 
*function applied against the elements of input.
**/
int[] input = {1350,1500,1365,1450,1490};
...some f(input[x]) happens here...
int[] output= {0   ,4   ,1   ,2   ,3   };

Naturally I understand you would need substantially more than 5 elements to determine with any measure of accuracy where the item would be, but rounding in combination with a check to see if the element is null before making the copy would still be faster than sorting the entire array by comparison.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:01:07+00:00Added an answer on June 13, 2026 at 2:01 pm

    I would look into a good linear regression algorithm.

    This has a link to some examples, just set all of your weights equal to 1:

    Weighted Linear Regression in Java

    Or there’s some more code here

    http://introcs.cs.princeton.edu/java/97data/LinearRegression.java.html

    Just plug in the independent values as x and the dependent values as y and voila!

    If you have any problem interpreting the data into linear form, y=mx+b:

    http://en.wikipedia.org/wiki/Simple_linear_regression

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do you know any open source tools or libraries (preferably Java, but that's not
I am looking for a mathematical function that produces something similar to a bell
The complement is the mathematical term for what I'm looking for, but for context
Essentially I am looking for a PHP function or equation that will output the
Take the following AS3 that will draw a curved line using curveTo() : var
I'm looking to tokenize Java/Javascript-like expressions in Javascript code. My input will be a
I'm looking for a simple component that displays mathematical expressions in Delphi. When I
I'm currently looking at different solutions getting 2 dimensional mathematical formulas into webpages. I
Looking for a perl one-liner what will find all words with the next pattern:
Looking for a control that allows to select one text value at a time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.