Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




3 posts

Wannabe Geek


# 173652 31-May-2015 13:55
Send private message

Hi, I need your help please.

I don't know computer programming or mathematics.
All I want is a simple PHP code for the following natural logarithm.

ln((N+1)/X)

and then a code to convert the natural logarithm to a percentile, as below.

 

(1 - exp (-L) ) * 100

I would have thought this would have been quite simple, but my web developers can't seem to get right.
I need your help urgently, I am desperate to get my website up and running and these calculations are critical.

Any help you can provide would be greatly appreciated.

Thanks in advance for all your help.

Glen

Create new topic
483 posts

Ultimate Geek

Trusted

  # 1315110 31-May-2015 14:20
Send private message

I'll bite.. firstly I am not a PHP programmer!

So the first part ln should convered by log

http://php.net/manual/en/function.log.php

The second part, the exp should covered by exp.

http://php.net/manual/en/function.exp.php

Are they interpreting your specification differently?

Have you given them sample results including the intermediate value L to validate against?

Are the developers using floating point values throughout the calculation?



3 posts

Wannabe Geek


  # 1315115 31-May-2015 14:33
Send private message


Hi
Thanks heaps for your reply. As I said in OP I know nothing at all on this subject, that's why I'm paying web developers but they don't seem to be getting it right.

ln ((N+1)/X)

N= Number of players
X = players finishing position.

 

(1 - exp (-L) ) * 100

L = Average of all Log scores

 


I have no idea if the developers are using floating point values throughout the calculation. I'm sorry for being so vague but this is about the extent of my knowledge on the topic.

I've paid these guys heaps and I'd expect they it should be relatively simple for them to write this code (everything else they have done is brilliant, except for getting this equation to work).

Thanks
Glen

 
 
 
 


23 posts

Geek


  # 1315192 31-May-2015 17:48
Send private message

I can help with PHP but not sure about the maths...

As obviously written as I can:

<?php
$n = 100;
$x = 15;
$result = log(($n+1)/$x);
echo "Log: {$result}";
echo "<br>";
$l = 1.5; // ??
$result = (1 - exp(-$l)) * 100;
echo "Result: {$result}";

Outputs:
Log: 1.907070315739
Result: 77.686983985157

Is that what you are looking for?
You should be able to see how that works, let me know if the equations are not correct.
These functions return floating point values, you may want to check out the accuracy of them depending on your application. E.g.: http://php.net/manual/en/language.types.float.php



3 posts

Wannabe Geek


# 1315199 31-May-2015 18:12
Send private message

Hi Critter
That's awesome!!! cool
They're the outputs I'm wanting, I'll pass on the code to my developer.
Thanks heaps!!


Create new topic



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

LG Electronics begins distributing the G8X THINQ
Posted 24-Oct-2019 10:58


Arlo unveils its first video doorbell
Posted 21-Oct-2019 08:27


New Zealand students shortlisted for James Dyson Award
Posted 21-Oct-2019 08:18


Norton LifeLock Launches Norton 360
Posted 21-Oct-2019 08:11


Microsoft New Zealand Partner Awards results
Posted 18-Oct-2019 10:18


Logitech introduces new Made for Google keyboard and mouse devices
Posted 16-Oct-2019 13:36


MATTR launches to accelerate decentralised identity
Posted 16-Oct-2019 10:28


Vodafone X-Squad powers up for customers
Posted 16-Oct-2019 08:15


D Link ANZ launches EXO Smart Mesh Wi Fi Routers with McAfee protection
Posted 15-Oct-2019 11:31


Major Japanese retailer partners with smart New Zealand technology IMAGR
Posted 14-Oct-2019 10:29


Ola pioneers one-time passcode feature to fight rideshare fraud
Posted 14-Oct-2019 10:24


Spark Sport new home of NZC matches from 2020
Posted 10-Oct-2019 09:59


Meet Nola, Noel Leeming's new digital employee
Posted 4-Oct-2019 08:07


Registrations for Sprout Accelerator open for 2020 season
Posted 4-Oct-2019 08:02


Teletrac Navman welcomes AI tech leader Jens Meggers as new President
Posted 4-Oct-2019 07:41



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.