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


Groups > comp.soft-sys.math.mathematica > #2020 > unrolled thread

Re: Why Indeterminate?

Started byBob Hanlon <hanlonr@cox.net>
First post2011-05-01 10:21 +0000
Last post2011-05-01 10:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Why Indeterminate? Bob Hanlon <hanlonr@cox.net> - 2011-05-01 10:21 +0000

#2020 — Re: Why Indeterminate?

FromBob Hanlon <hanlonr@cox.net>
Date2011-05-01 10:21 +0000
SubjectRe: Why Indeterminate?
Message-ID<ipjc82$j15$1@smc.vnet.net>
A[a_List, x_] := x*(1 - x)*Sum[(a[[j]]*(1 - 2*x)^(j - 1))/(1 - a[[3]]*(1 - 2*x)), 
    {j, 1, 2}]

A[Array[a,3],1/2]

Power::indet: Indeterminate expression 0^0 encountered. >>
Indeterminate

A[Array[a,3],x]/.x->1/2

a[1]/4


Looks like a bug. The workaround is to define the function with the substitution that you used.


A[a_List, x_] := Module[{t}, 
   t*(1 - t)*Sum[(a[[j]]*(1 - 2*t)^(j - 1))/(1 - a[[3]]*(1 - 2*t)), {j, 1, 2}] /. 
    t -> x]

A[Array[a,3],1/2]

a[1]/4


Bob Hanlon

---- Themis Matsoukas <tmatsoukas@me.com> wrote: 

=============
Consider this expression:

A[a_List, x_] := x (1 - x)  \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(j = 1\), \(2\)]
\*FractionBox[\(a[[j]] 
\*SuperscriptBox[\((1 - 2\ x)\), \(j - 1\)]\), \(1 - 
     a[[3]] \((1 - 2  x)\)\)]\)
a = Range[3];

Evaluation at x=0.5 gives

A[a, 0.5]

Indeterminate

..but I can get the right answer if I use

A[a, x] /. x -> 0.5

0.25

What puzzles me is that there is no obvious indeterminacy in the original expression at x=0.5. 

Thanks

Themis


[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web