Christopher2222

MaplePrimes Activity


These are questions asked by Christopher2222

Just for fun last night I thought I'd try to whip up a simulation of the simple card game war.  The hoyle rulebook - evenly divide the cards up between 2 players facedown, turn over top card, highest card wins.  In the event of a tie the higher of the next overturned card wins (the more common variant is to play 3 facedown cards and turn up the 4th) - but that introduces more complexity to the programming ... I thought I'd tackle that later, but first ...

How can I sort a list with radicals?

a:=[sqrt(8),sqrt(2),sqrt(39),-sqrt(5),sqrt(26)]

sort(a) returns the same list in the same order. 

I want to exactly (well roughly speaking) overlay two lines from different graphs. 

So suppose I had two datasets, 

a:=[1.4,2.1,4.6,3.7,3,2.1,2,1,1.5]:
b:=[78,75,97,98,105,95,88,75,67]:

with(plots):

aa:=listplot(a):
bb:=listplot(b):

I want to overlay the two lines to compare them.  I transformed them into 3d then rotated to overlay but maple keeps scaling the axes to fit. 

Any ideas?

 

restart;gc()

a:=Matrix(1..5,1..5,(rand(1..1000))/1000)

b:=a*1000;

b[4,4] has the value 858.000000000000114   Why isn't this value 858. so that it matches the consistancy of the rest of the matrix??

 

How does one select rows of a Matrix with say column three having values less than 4?

If for example,   

a:=Matrix(1..5,1..5,rand(1..10)):

One way that I know of is to first convert the Matrix to a listlist

b:=convert(a,listlist):
and then you can use
c:=select(b->b[3]<4,b)
then
d:=convert(c,Matrix)

Is there a way to that without all the conversions?

First 71 72 73 74 75 76 77 Last Page 73 of 99