Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10842

Re: Sum of terms --> list

From Dana DeLouis <dana01@me.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Sum of terms --> list
Date 2012-07-08 23:17 +0000
Message-ID <jtd4ec$9r3$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


> LB[z_] := List @@ B[z]
> LB[3]  (* NOT OK*)

>  LB[3] gives   11/3 - this is a sum of term again - why ?


Hi.  I believe B[3] is evaluated first to

1/(2-3) + 3/(4-3) + 5/(6-3)

Which is immediately reduced to 11/3.

Then the function -List- is applied to this reduced form, which returns just 11/3

One needs to hold the evaluation, or perhaps just:

B[z_]:=1/(2-z)+3/(4-z)+5/(6-z)

LB[z_]:=(List@@B[#1]) /. #1 -> z

LB[x]
{1/(2-x), 3/(4-x), 5/(6-x)}

LB[3]
{-1, 3, 5/3}

= = = = = = = = = =
HTH  :>)
Dana DeLouis
Mac & Math 8
= = = = = = = = = =




On Jul 7, 5:31 am, b...@ANTYSPAM.ap.krakow.pl wrote:
> I have found this thread, an I heve additional question about List@@
> 
> see on example:
> 
> ----------
> ClearAll["`*"];
> B[z_] := 1/(2 - z) + 3/(4 - z) + 5/(6 - z);
> B[z] (*OK*)
> LB[z_] := List @@ B[z]
> LB[z] (*OK*)
> LB[z] /. z -> 3 (*OK*)
> 
> LB[3]  (* NOT OK*)
> ------------------------
> 
>  LB[3] gives   11/3 - this is a sum of term again - why ?
> Is a simply way to convert B[z] ---> LB[z]
> where LB[z] is a list of simple functions of z ?
> 
> greetings, Olaf

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: Sum of terms --> list Dana DeLouis <dana01@me.com> - 2012-07-08 23:17 +0000
  Re: Sum of terms --> list bar@ANTYSPAM.ap.krakow.pl - 2012-07-14 05:27 +0000

csiph-web