Algorithm for Generating Percentage Amounts

  • Thread starter Thread starter natedgreat3
  • Start date Start date
  • Tags Tags
    Algorithm
natedgreat3
Messages
3
Reaction score
0
Hey guys,

Not totally sure this thread belongs in this section, feel free to move.

I'm trying to formulate an algorithm for an unusual problem.

- Generate a pie chart with X number of wedges.
- Each wedge is X percentage bigger then the one before it.
- Percentage amounts of all wedges must add up to 100 (thereby completing the pie chart)

So for example, in Excel I can create a pie chart with 5 wedges, and each wedge is 20% bigger then the previous one. It gives me these numbers (rounded).

Wedge 1: 13.43797%
Wedge 2: 16.125564%
Wedge 3: 19.3506768%
Wedge 4: 23.22081216%
Wedge 5: 27.86497459%

But I got that result by trial and error of Wedge 1's value until the final output of the pie chart hit 100%. How do I calculate Wedge 1's value simply based off the number of wedges in the pie, and the percentage amounts from one wedge to the next?

I appreciate any help you guys can provide =]
 
Physics news on Phys.org
Okay cool, except a geometric series doesn't have to add up to a maximum amount, in this case 100% =/
 
That's where doing math comes in. If your starting wedge has a%, then you want
a + 1.2a + (1.2)2a + 1.23a + 1.24a = 100

Notice that 1.2 a is 20% larger than a, and 1.22a is 20% larger than 1.2a, etc. Now all you have to do is solve for a.
 
If you don't like algebra, suppose the first wedge is size 1.
You then have 5 wedges with sizes 1, 1.2, 1.44, 1.728, 2.0736 which add up to 7.4416
So you need to scale up the sizes by 100 / 7.4416 = 13.43797 - which is what you got by trial and error.
 
Thanks guys, you rock =]
 
Thread 'Determine whether ##125## is a unit in ##\mathbb{Z_471}##'
This is the question, I understand the concept, in ##\mathbb{Z_n}## an element is a is a unit if and only if gcd( a,n) =1. My understanding of backwards substitution, ... i have using Euclidean algorithm, ##471 = 3⋅121 + 108## ##121 = 1⋅108 + 13## ##108 =8⋅13+4## ##13=3⋅4+1## ##4=4⋅1+0## using back-substitution, ##1=13-3⋅4## ##=(121-1⋅108)-3(108-8⋅13)## ... ##= 121-(471-3⋅121)-3⋅471+9⋅121+24⋅121-24(471-3⋅121## ##=121-471+3⋅121-3⋅471+9⋅121+24⋅121-24⋅471+72⋅121##...
##\textbf{Exercise 10}:## I came across the following solution online: Questions: 1. When the author states in "that ring (not sure if he is referring to ##R## or ##R/\mathfrak{p}##, but I am guessing the later) ##x_n x_{n+1}=0## for all odd $n$ and ##x_{n+1}## is invertible, so that ##x_n=0##" 2. How does ##x_nx_{n+1}=0## implies that ##x_{n+1}## is invertible and ##x_n=0##. I mean if the quotient ring ##R/\mathfrak{p}## is an integral domain, and ##x_{n+1}## is invertible then...
The following are taken from the two sources, 1) from this online page and the book An Introduction to Module Theory by: Ibrahim Assem, Flavio U. Coelho. In the Abelian Categories chapter in the module theory text on page 157, right after presenting IV.2.21 Definition, the authors states "Image and coimage may or may not exist, but if they do, then they are unique up to isomorphism (because so are kernels and cokernels). Also in the reference url page above, the authors present two...

Similar threads

2
Replies
56
Views
10K
Replies
3
Views
2K
Replies
11
Views
4K
2
Replies
61
Views
11K
Replies
25
Views
4K
Replies
48
Views
11K
Back
Top