
Math Software Math Software  Mathematica, Matlab, Calculators, Graphing Software 
 LinkBack  Thread Tools  Display Modes 
December 12th, 2016, 07:39 PM  #1 
Newbie Joined: Dec 2016 From: YUGOSLAVIA Posts: 2 Thanks: 0 Math Focus: PROBABILITY 
Hello people, I am writing a program (in java but not important), and I need to write a method (function) which is acting like math function f(x) which is described with following table: X  f(x) 1  100 10  10 100  1 1000  1 10000  1 100000  1 . . . (F(X) ALWAYS 1 FOR NUMBERS GREATER THAN 100) so, what I want to create is a math formula which has those results, so that I can implement it in my program. Note: F(x) does not have to be exactly as stated in the table. It can have +20% deviation from the numbers stated in the table. For example: F(1) could be 120, f(10) could be 9.5, or anything like it, but in general it should be close to those numbers, and it should never go below 1. I do not know how to create a math function which does that. Plus, it would be great it the function does not include high level math in formula, because this formula should be implementable inside method in java programming language. (additional information (not important for this question): I am writing my own graphic user interface, and in that interface I am writing scroll bar class. Scroll bar class has size property. And I want the size of the scroll bar to be around 100 pixels in case I have 1 items in the list, around 10 pixels if I have 10 items, around 1 pixel if I have 100 items and more). Anyway, does anyone know which math formula can give results similar to those in the table? Thanxy. Last edited by skipjack; December 13th, 2016 at 02:54 AM. 
December 12th, 2016, 08:22 PM  #2 
Senior Member Joined: Sep 2015 From: USA Posts: 1,696 Thanks: 861 
$1 + 129.225 e^{0.266433 x}$ seems to do a pretty good job 
December 12th, 2016, 08:50 PM  #3 
Newbie Joined: Dec 2016 From: YUGOSLAVIA Posts: 2 Thanks: 0 Math Focus: PROBABILITY 
HELLO ROMSEK, YES IT DOES. I DID NOT FIGURED IT OUT MYSELF. YOUR FUNCTION f(x) = 1+129.225e−0.266433x IS WORKING GREAT. THANK YOU. JUST, AS I SAID, IT CAN HAVE IN MY CASE UP TO +20% DEVIATION FROM THOSE NUMBERS, SO ACTUAL FUNCTION I WILL IMPLEMENT IS: 1+129e−0.27x JUST FOR SIMPLICITY (BECAUSE IT TAKES LESS TIME TO EXECUTE IN COMPUTER). THANK YOU. 

Tags 
creating, function, results 
Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
The rational zero theorem and creating a function?  GumDrop  Real Analysis  3  September 9th, 2016 03:26 PM 
What stops me from creating my own function?  John Travolski  Abstract Algebra  5  October 20th, 2015 07:22 AM 
Need help creating and equation  hoshiemotto  Algebra  5  September 22nd, 2014 05:55 PM 
Creating a function  tedward570  Algebra  3  October 2nd, 2012 04:33 PM 
Creating a function with given points  SHRock  Algebra  1  September 29th, 2010 02:28 AM 