The Sigma Function on the WP34



#9

How is the Sigma function used?

I am trying to find the sum:

10
Sigma .5^x * .2 (= .399805)
x=0

If understand the manual correctly, I am supposed to enter the counter in the x stack as ccc.fffiii:

So I would enter 0.01001? (final = 10, increment = 0, c = 0)

I am not getting the answer I expected. Please help.

Here is what I have:

LBL FF
.
5
x<>y
y^x
.2
x
RTN

.01001 g [3] f [ENTER] FF ?? (I'm not getting what I am expecting, I get .2000)

Thanks in advance.


#10

The source for sum is in the subversion repository.


The big problem I think you're encountering is that the loop is a DSE loop not an ISG one. So, try entering 10 SUM'FF

The finish value defaults to 0 and the increment/decrement defaults to 1.


- Pauli


#11

Small correction.

You need to start the sum from 11 and subtract 1 at the start of the function. The sum stops before the zero term is evaluated.

Thus,

    LBL A
DEC x
.
5
x<>y
y^x
5
/
RTN

Then 11 g Sigma A gives 0.3998046875


- Pauli

#12

Quote:
The big problem I think you're encountering is that the loop is a DSE loop not an ISG one. So, try entering 10 SUM'FF

Not just him. ;-) That's one of the things that made me read the manual twice before I finally realized that the sum and product loops are working backwards.

Pauli, I think this is a quite unintuitive feature. I'm a big fan of POLA user interfaces (policy of least astonishment - things should work the way the average user expects). That's why I think the sum and product functions should count upwards. Simply think of the way you write down a sum: it's from 1 to n, not from n down to 1. And this way there is also no problem with an index starting at zero. ;-)

Dieter


#13

Originally I had both product and sum counting up then the documentation had them counting down so I switched.

There are arguments both ways on this:

  • Counting up limits you to a final value to 999, counting down doesn't.

  • Counting up lets you get a zero index easily, counting down doesn't.

  • Counting up requires more keystrokes (e.g. sum 1 to 5 requires 1.005 SUM as opposed to 5 SUM).

  • For summations whose terms diminish as the index increases (i.e. many), counting down is generally more accurate.

The change to make the count go the other way is trivial -- the DSE becomes an ISG in the main loop. I guess we could implement alternate commands to count the other way or switch to counting up again. I'm indecisive on this one, like I said advantages both ways.

- Pauli


Edited: 25 Apr 2011, 9:41 p.m.


#14

how about a flag to decide (switch) if counting up or down is used?

(but I bet you are tight on flag usage though)

Anyway, very nice work done, I'm looking forward to buy a 30b and starting to flash the business out of it ;-)

Thanks a lot for more fun!


#15

We wouldn't use a flag for this, we'd define two commands for each.

- Pauli


#16

How about using the sign of the summation range as a way to tell if you are summing up or down. Let's say a negative value means you are counting down, and vice versa?

Namir


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP50g: Writing a function that returns a function Chris de Castro 2 441 12-10-2013, 06:49 PM
Last Post: Han
  WP34 cable Mike Powell 9 648 09-29-2013, 07:27 AM
Last Post: Mike Powell
  [Sigma]DAT on the 50G Matt Agajanian 2 206 09-06-2013, 09:46 PM
Last Post: Matt Agajanian
  [WP 34s] Summation Function (Sigma) Paul C 11 669 01-29-2013, 07:42 AM
Last Post: C.Ret
  WP34 S: Fonts (a bit OT) Marcus von Cube, Germany 18 1,001 02-24-2012, 11:07 AM
Last Post: Luiz C. Vieira (Brazil)
  [WP34] Poor Person's Overlay Les Wright 6 381 11-26-2011, 04:37 PM
Last Post: Les Wright
  WP34-S Flashing Cable Repair? svisvanatha 5 323 10-03-2011, 08:44 PM
Last Post: svisvanatha
  WP34 S 2.1 released on SourceForge Marcus von Cube, Germany 1 226 08-02-2011, 04:23 PM
Last Post: Marcus von Cube, Germany
  WP34 again Paul Dale 86 3,118 07-25-2011, 10:23 PM
Last Post: Paul Dale
  WP34 base page view Cristian Arezzini 6 416 04-26-2011, 05:51 AM
Last Post: Paul Dale

Forum Jump: