Thanks for that SredniVashtar with regards to position I need to make some kind of rule for n, I tried liss = 7 - li to get {-11, -15, 3, -3}
But I come up with difficulties because if I had 11 -li which gives me {-7, -11, 7, 1} I need to find the position of the smallest positive number
If I have a list say
li = {18, 22, 4, 10}
and I want to add for example 7 to this list
Join[li, {7}] to get {18, 22, 4, 10, 7},
can I insert the 7 after the 4, to get {18, 22, 4, 7, 10},
I can't just use Sort[ {18, 22, 5, 10, 7}] as I don' t want to change the order of the whole list?
I am using
co = 0;
co++
If[Mod[co, 20, 1] > 10, 1, 0];
which is used in an iterative function
which produces 10 1' s 10 0' s, 10 1' s 10 0' s and so on ...
Could I use a similar method to produce 10 1' s then 5 0' s, 10 1's 5 0' s and so on...
Sorry, didn't make it very clear
sublist 1 = {{1, 1}, {1, 5}, {1, 8}}
sublist 2 = {{2, 6}, {1, 10}, {0, 12}} ...
so I want a new list that will be {sublist 1,sublist 2,sublist 3,sublist 4,sublist 9,sublist 10, sublist 11,sublist 12}
And another {sublist 5,sublist 6,sublist 7,sublist...
I am trying to create a list of 5 random numbers between 1 and 20
In[62]:= RandomInteger[{1, 20}, 5]
Out[62]:= {10, 11, 9, 8, 1}
But is it possible to exclude the number 10 from appearing?
lis= {{{2, 1}, {3, 2}, {8, 2}}, {{9, 6}, {1, 0}, {0, 2}}}
I am trying to reverse the subsublist so {2,1} becomes {1,2}, {3,2} becomes {2,3}...
I have tried Map[Reverse, Flatten[lis, 1]] but this creates
{{1,2},{2,3},{2,8},{6,9},{0,1},{2,0}}
which erases my sublist
Is there a way I...
If I have a list;
list={ {{1, 2}, {1, 3}, {1, 5}},
{{2, 2}, {2, 4}, {2, 1}},
{{3, 3}, {3, 5}, {3, 2}} }
and want to plot it using ListPlot[list]
Is it possibe to colour all the 1st pairs of the list e.g. {1,2}, {2,2}, {3,3} blue, {1,3},
{2,4},{3,5} green and {1,5}, {2,1}, {3,2} red using...
If I have 2 list which are made up of pairs of numbers
e.g.
list1 = {{4, 5}, {2, 10}, {0, 15}}
list2 = {{5, 2}, {3, 7}, {1, 12}}
is there a way I can apply a function (that I have already created, f[x_]) on the lists which runs for e.g. 5 iterative steps with list1 then apply the same...
I want to create an If statement that states; if the elements in, list1>0 , true subtract list2, false keep value from list1 so that i
end up with ans: {0,2,5,4}
list1 = {0, 2, 8, 9}
list2 = {1, 0, 3, 5}
I don't know how to represent the elements in the lists so that my If statement works
{ {{1, 2}, {1, 3}, {1, 5}},
{{2, 2}, {2, 4}, {2, 1}},
{{3, 3}, {3, 5}, {3, 2}} }
Is it possibe to colour all the 1st terms of the list e.g. {1,2}, {2,2}, {3,3} blue, {1,3},
{2,4},{3,5} green and {1,5}, {2,1}, {3,2} red using PlotMarker or a simular function
Also, can i find the mean of...
I am trying to create 2 list of random numbers of the same length
The 1st list random list i can do
RandomIntegerRandomInteger[{1, 7}, 10]
to get {6, 5, 4, 7, 2, 1, 5, 5, 2, 6}
the 2nd list however i want 10 numbers from 1-30 that are all different and in order,
what do i need to add to...
Hi
i want the x -axis to go from 1 to 5, then plot the 2nd element of each pair, (so that they appear in a horizontal row ) for
lis = {{4, 2}, {1, 3}, {2, 5}}
I' ve been playing around with ListPlot and using it with Map[Last,
lis] but not getting what i want
my goal is to repeat...
Thanks for that.
Using one of the codes you suggested, is there a way to implement it with initial conditions, so starting with pairs of nuumbers and applying a function to all the 1st elements and another function to and the 2nd elements in the list.