Results 1 to 9 of 9

Thread: Need this formula re-arranged

  1. #1

    Thread Starter
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Need this formula re-arranged

    Hi folks, it's not like me to post questions, but here we go....

    I've got this formula:
    Code:
    T = N * (B + [(N-1) * E]/2 )
    Unfortunately the variable I want to calculate is N, and no matter what I do I can't seem to get N on it's own

    How should it be?

    N = ????

  2. #2
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611
    Askthis in the math forum ,they might solve it within 5 min or so.
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  3. #3
    Addicted Member Bazzlad's Avatar
    Join Date
    Jun 2003
    Posts
    227
    is E the exponential function?
    *And you'll see, Everything you stand for is fake*
    http://www.rhesusrock.com

  4. #4
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    n=+/- (sqr(8*e*t+(2*b-e)^2) - 2*b +e) / 2*e
    Last edited by DiGiTaIErRoR; Aug 29th, 2003 at 06:17 AM.

  5. #5
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383
    I think that comes from rearranging the formula to
    0= n^2E +n(2B-E) -2T
    then solving the quadratic equation.
    Am I right?

    I used to be able to do these, now Ive turned a bit thick from lack of practice

  6. #6

    Thread Starter
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    Originally posted by DiGiTaIErRoR
    n=+/- (sqr(8*e*t+(2*b-e)^2) - 2*b +e) / 2*e
    perfect!!

    I've got no idea how you found it, but it returns the right answer for all my test cases.

    Thanks DiGiTaIErRoR

  7. #7
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383
    Originally posted by si_the_geek
    perfect!!

    I've got no idea how you found it, but it returns the right answer for all my test cases.

    VB Code:
    1. T = N * (B + [(N-1) * E]/2 )
    2. T = NB + N * ([(N-1) * E]/2 )
    3. T = NB + [(N ^2 - N) * E] /2
    4. 2T = 2NB + (N ^2 - N) * E
    5. 2T = 2NB + N ^2 * E - NE
    6. 0 = EN ^2 + (2B-E)N - 2T
    7. 0 = ax^2  +  bx     + c
    8.  
    9. x = [-b +- SQR(b^2 - 4ac)] /2a
    10.  
    11. Therefore
    12. N = [-(2B-E) +- SQR([2B-E]^2 - 8ET)] /2E

  8. #8

    Thread Starter
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    Originally posted by DiGiTaIErRoR
    I'm positive:

    n=(2*t/n-2*b)/e+1

    is also correct.
    True, but it also doesn't have N on it's own

    This isn't something that needs to run fast, so the first answer you posted is certainly good enough!

    Thanks again

  9. #9
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Originally posted by si_the_geek
    True, but it also doesn't have N on it's own

    This isn't something that needs to run fast, so the first answer you posted is certainly good enough!

    Thanks again
    I should get more sleep.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width