My Math Forum Trying to find the percentage of 2 numbers

 Elementary Math Fractions, Percentages, Word Problems, Equations, Inequations, Factorization, Expansion

 May 15th, 2017, 10:35 PM #1 Newbie   Joined: May 2017 From: Australia Posts: 2 Thanks: 0 Trying to find the percentage of 2 numbers Sorry I'm extremely bad at maths and I'm unsure where to place this haha. Blue = 90 Red = 10 90% (the percentage increases the higher blue gets over red) Blue = 10 Red = 90 10% (the percentage decreases the higher red gets over blue) Blue = 960 Red = 480 75% (Blue is higher, I can do this equation in my head I THINK haha, but I want a way I can get it through equations?) Blue = 45353 Red = 45353 50% Blue = 453 Red = 0 100% Blue = 0 Red = 5432 0% I am attempting to do this with coding and was wondering if (hopefully) there is a way to find the percentage using easy arithmetic? I really appreciate any help, this will help me so much if someone knows how to do this!
May 15th, 2017, 11:11 PM   #2
Senior Member

Joined: Sep 2015
From: Southern California, USA

Posts: 1,412
Thanks: 716

Quote:
 Originally Posted by PyuaNaoko Sorry I'm extremely bad at maths and I'm unsure where to place this haha. Blue = 90 Red = 10 90% (the percentage increases the higher blue gets over red) Blue = 10 Red = 90 10% (the percentage decreases the higher red gets over blue)
both above correct

Quote:
 Blue = 960 Red = 480 75% (Blue is higher, I can do this equation in my head I THINK haha, but I want a way I can get it through equations?)
this one is wrong. it's 67.7%

Quote:
 Blue = 45353 Red = 45353 50% Blue = 453 Red = 0 100% Blue = 0 Red = 5432 0%
these are all correct

I don't know what you're using to code with but I'd write a function that takes a list of values, sums that list, then returns the list divided by the sum times 100.

May 16th, 2017, 01:23 AM   #3
Newbie

Joined: May 2017
From: Australia

Posts: 2
Thanks: 0

Quote:
 Originally Posted by romsek both above correct this one is wrong. it's 67.7% these are all correct I don't know what you're using to code with but I'd write a function that takes a list of values, sums that list, then returns the list divided by the sum times 100.
You mean add both numbers together then divide by 100?

May 16th, 2017, 01:34 AM   #4
Senior Member

Joined: Apr 2014
From: Glasgow

Posts: 2,049
Thanks: 680

Math Focus: Physics, mathematical modelling, numerical and computational solutions
Quote:
 Originally Posted by PyuaNaoko You mean add both numbers together then divide by 100?
No, he means

Quote:
 write a function that takes a list of values, sums that list, then returns the list divided by the sum times 100.
Let's put your red and blue values in a list...

[$\displaystyle 960, 480$]

Now sum the items in that list...

$\displaystyle 960 + 480 = 1440$

Then return the list divided by the sum times 100.

First item in the list: $\displaystyle (960/1440)*100 = 66.\dot{6}$
Second item in the list: $\displaystyle (480/1440)*100 = 33.\dot{3}$

The new list is [ $\displaystyle 66.\dot{6}, 33.\dot{3}$]

So basically, using fractions, 2/3 of your total is "blue" and 1/3 is "red".

The instructions that Romsek gave will allow you to calculate, for any number of values, the percentage contributions those numbers give in the list to the total.

Just so you know, there's a name for this process... it's called "Normalization". The resulting list is called a "normalized distribution". It's often used in data analysis and statistics. In your example problems you are normalising a discrete distribution and there's mathematics for doing the same thing with continuous distributions too

Last edited by Benit13; May 16th, 2017 at 01:38 AM.

May 21st, 2017, 12:40 PM   #5
Senior Member

Joined: Oct 2013
From: New York, USA

Posts: 549
Thanks: 78

Quote:
 Originally Posted by romsek this one is wrong. it's 67.7%
I think you know the answer and made a typo. It's 66.7% when rounded.

 Tags find, numbers, percentage

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post wallywizard Elementary Math 4 August 3rd, 2016 10:46 PM mick7 Elementary Math 6 August 21st, 2015 09:18 PM loach Elementary Math 5 September 6th, 2014 04:33 PM OrangeLightning Elementary Math 6 April 23rd, 2013 02:14 PM Zshan96 Elementary Math 3 September 6th, 2012 06:18 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top