MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Unevaluated values of a[[i]]+b[[j]]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65241] Re: [mg65211] Unevaluated values of a[[i]]+b[[j]]
  • From: János <janos.lobb at yale.edu>
  • Date: Tue, 21 Mar 2006 07:46:02 -0500 (EST)
  • References: <200603181140.GAA09748@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On Mar 18, 2006, at 6:40 AM, Alexandre Costa wrote:

> Dear group,
> Suppose a have a = {3,4,4} and b = {4,3,8}.
> I want to see the Unevaluated numerics values of  a[[i]]*b[[j]],
> a[[i]]+b[[j]], a[[i]]/b[[j]], a[[i]] - b[[j]].
>
> The NonCommutativeMultiply operator (**)  solves the case of  a[[i]] 
> *b[[j]].
> But suppose I want to extend that NonCommutativeMultiply operator  
> (**) to
> others operations: +, -, / , i.e., see the Unevaluated numeric  
> values of
> a[[i]]+b[[j]], a[[i]]/b[[j]], a[[i]] - b[[j]]. Does anybody have a  
> clue
> how to do this ?
>
> Suppose I have the expression for the roots of the quadratic  
> equation: -
> b[[index]]^2 + Sqrt[delta]/2*a[[index]]
> How can I see at once all the numeric values unevaluated on that  
> expression.
>
> In short words, I have lenghtly expressions(with  
> sums,subtraction,divisions
> and multiplications and powers) and I want to check each numeric  
> value of
> each term in the original unevaluated formula containing elements  
> such as a[[index]] .
> I was thinking in a operator or function to solve all this issue.
> Any help is very welcome,
> Thanks,
> Alex
>

Here is a newbie approach for +.  Similarly it can be done for the  
other operators

In[1]:=
a = {3, 4, 4};
b = {4, 3, 8};

In[3]:=
as = ToString /@ a;
bs = ToString /@ b;

In[11]:=
as[[1]] + bs[[1]]
Out[11]=
"3" + "4"

When it comes to evaluation:

In[19]:=
ToExpression /@ (as[[1]] +
    bs[[1]])
Out[19]=
7

János



  • Prev by Date: Grouping similar indices together in an expression
  • Next by Date: Quotient group/space notation
  • Previous by thread: Unevaluated values of a[[i]]+b[[j]]
  • Next by thread: Re: Unevaluated values of a[[i]]+b[[j]]