vs140580

500 Reputation

8 Badges

5 years, 110 days

MaplePrimes Activity


These are questions asked by vs140580

Python out will be as below it can be any arbitray Matrix of this for 

A:= [[0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
 [1. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1.]
 [0. 1. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
 [0. 0. 1. 0. 1. 0. 0. 1. 0. 0. 0. 0. 0.]
 [0. 0. 0. 1. 0. 1. 0. 0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 1. 0. 1. 0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 1. 0. 1. 1. 0. 0. 0. 0.]
 [0. 0. 0. 1. 0. 0. 1. 0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0. 1. 0. 0. 1. 1. 1. 0.]
 [0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0.]
 [0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]]

we can observe the ". " is their which we need to replace by , and at the end of each ] inside it should need to be ],

If anyone can give a direct code like if i copy paste the above matrix it will output the maple type matrix for my input

Now A becomes

A:=[[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]

To remember the progam should work any arbitary such matricies not for this only case.

Any good online training for maple soft to purchase 

K := x^3*y^4 + 6*x^2*y^3 + 3*x*y^4 + x^2*y^2 + 2*x*y^3;

f := (x, y) -> K; f(t, x);

 

It displays as x^3*y^4 + 6*x^2*y^3 + 3*x*y^4 + x^2*y^2 + 2*x*y^3;

 

instead of t^3*x^4 + 6*t^2*x^3 + 3*t*x^4 + t^2*x^2 + 2*t*x^3

 

But if i do direct assignment like f := (x, y) ->x^3*y^4 + 6*x^2*y^3 + 3*x*y^4 + x^2*y^2 + 2*x*y^3;

Then f(t,x) becomes and displays as t^3*x^4 + 6*t^2*x^3 + 3*t*x^4 + t^2*x^2 + 2*t*x^3;

But I want it like f:=(x,y)->K Later I should be able to make f(t,x) or f(p,s) like that K i can take some arbitary polynomial

 

What I mean by shortest distance between vertex and edge is

 

In the above petersen graph consider the vertex say 1 it's distance to

(1,6) will be 0 as 1 is part of the same edge

((1,2) will be 0 again

(1,5) it will zero again

(5,8) will be 1 that is (1,5)-(5,8)

(8,9) it will be 2 that is (1,5)-(5,8)-(8,9)

(5,4) it will be 1 that is (1,5)-(5,4)

(9,10) it will be 2 (1,5)-(5,4)-(9,10)

Etc for all edges the graph from a given vertex v given a Graph G

The order in which the edges are chosen to find the distances should be maintained so that each index in the list correspond to distance of that vertex from the same edge in different vertex lists in a order 

Kind help I apologize to take your time 

In output I need a list say T=[0, 0,1,2,..]

   Data given

   List Given

  L:=[A,B,A,C,A,B,D,E,A,F,G,H,H,G,I,P,Q,W,A]

 

    I want the output to be a frequency table

    Frequency says number of times each Data occurs in the list

    I want output in the form of a table

    Data need not be always A,B,C,D etc it can be any text.

Data

Frequency

A

5

B

2

C

1

D

1

E

1

F

1

G

2

H

2

I

1

P

1

Q

1

W

1

 

I want to export this outputed table to word or Excel

First 19 20 21 22 23 24 25 Page 21 of 25