# Applying Reduce[] to a table [duplicate]

I have a table for example:

t = Table[k,{k,5}]

which returns

{1,2,3,4,5}

and for every element in this table I want to check when it is $\leq 1 + a$.

I used the Reduce commend as Reduce[t<1+f,f] but it doesn't work. How can I do that, without writing all inequalities separately ?

• Look at Map. – rcollyer Dec 8 '13 at 23:33
• Do you want all those inequalities to hold simultaneously? – Dr. belisarius Dec 8 '13 at 23:37
• @belisarius Yes – Ziva Dec 8 '13 at 23:40
• Then look at the Edit in my answer – Dr. belisarius Dec 8 '13 at 23:46

Thread[Array[# &, 5] <= 1 + a]
(*
{1 <= 1 + a, 2 <= 1 + a, 3 <= 1 + a, 4 <= 1 + a, 5 <= 1 + a}
*)


Edit

Probably you want something like

t = Table [k, {k,5}];
Reduce[And @@ Thread[t  <= 1 + a], a]
(*
a >= 4
*)


But I'm not quite sure

• Or Range[] or Table[] instead of Array[] – Dr. belisarius Dec 8 '13 at 23:34
• the table which I wrote was only a suggestion. I want to reduce a table of values which have very different valueslike 0.0005,0.678,0.98999,1,456. And in your solution, can I do something like this? And I want to hold all those inequalities simultaneously – Ziva Dec 8 '13 at 23:46
• @Ziva Yes. Take a look at the EDIT – Dr. belisarius Dec 8 '13 at 23:47
f[a_] := Map[Reduce[# <= a] &, Table[k, {k, 5}]]

f

{True, True, True, False, False}


What you want to do is to check whether something (x) is less than 1+a. A simple approach is to make this a function:

f[x_, a_] := x < 1 + a


Now you can observe that f[10,6] is False and f[10,11] is True. Too apply this to a long list, use Map:

list = Range;
f[#, 3] & /@ list
{True, True, True, False, False, False, False, False, False, False}


The abbreviated form f[#, 3] & /@ list is short for the Map function.