Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Hold & Evaluate
Replies: 4   Last Post: Feb 25, 2013 2:20 AM

 Messages: [ Previous | Next ]
 Tomas Garza Hernandez Posts: 264 Registered: 4/15/05
Re: Hold & Evaluate
Posted: Feb 25, 2013 2:19 AM

Why not
In[2]:= Rationalize/@Table[n/(n+0.1 (n+1)),{n,1,15}]
Out[2]= {5/6,20/23,15/17,8/9,25/28,60/67,35/39,80/89,9/10,100/111,55/61,120/133,65/72,28/31,75/83}
-Tomas

> From: Serych@panska.cz
> Subject: Hold & Evaluate
> To: mathgroup@smc.vnet.net
> Date: Sat, 23 Feb 2013 23:31:40 -0500
>
> Dear mathgroup,
> I would like to generate sequence in the form:
>
> 1/1.2, 2/2.3, 3/3.4, 4/4.5, etc.
>
> It is very simple by a Table function:
>
> Table[n/(n + 0.1 (n + 1)), {n, 1, 15}]
>
> but as there are real numbers in denominators, Mathematica evaluates all and generates something like:
>
> {0.833333, 0.869565, 0.882353, 0.888889, 0.892857, 0.895522, etc.}
>
> How to evaluate numerators and denominators separately and print the sequence in that "fraction like" form?
>
> I tested:
>
> #[[1]]/#[[2]] & /@ Table[{n, n + 0.1 (n + 1)}, {n, 1, 15}] and than used Hold[] and Evaluate[]:
>
> Hold[Evaluate[#[[1]]]/Evaluate[#[[2]]]] & /@
> Table[{n, n + 0.1 (n + 1)}, {n, 1, 15}]
>
> But it doesn't work as the Hold has "veto" power over any evaluation.
>
> Thanks in advance for any idea, how to do it
>
> Jakub
>

Date Subject Author
2/25/13 Simons, F.H.
2/25/13 Bob Hanlon
2/25/13 Tomas Garza Hernandez
2/25/13 Tomas Garza Hernandez