das_1404

73 Reputation

6 Badges

19 years, 95 days

MaplePrimes Activity


These are replies submitted by das_1404

Thanks for your comments.  Have tried changing my variable names to something other than single letters - with some improvement, but still the problem persists.  I suspect that after the the loop value mm=3, it is retaining the values of some variables, when going on to use the next computations.  In the documentation for the function 'cat' it creates global variables.  I suspect it is these which are getting confused with my local variables.

  fyi: The full program solves a Wordbuilder puzzle ie to create 3, 4 and 5 letter words from from a given list of 5 letters.  It does this by creating all the possible permutations and then checking to see if they exist in the dictionary.  Some "words" work - but others (possibly involving the letters a or n) seemed not to work.

Thanks for your comments.  Have tried changing my variable names to something other than single letters - with some improvement, but still the problem persists.  I suspect that after the the loop value mm=3, it is retaining the values of some variables, when going on to use the next computations.  In the documentation for the function 'cat' it creates global variables.  I suspect it is these which are getting confused with my local variables.

  fyi: The full program solves a Wordbuilder puzzle ie to create 3, 4 and 5 letter words from from a given list of 5 letters.  It does this by creating all the possible permutations and then checking to see if they exist in the dictionary.  Some "words" work - but others (possibly involving the letters a or n) seemed not to work.

Great! Thanks - that works fine, except it is of type symbol - so am I right in thinkig it still needs to be converted to string, as in: convert(cat(seq(op([i],p1[1]),i=1..3)),string); ...or will symbol expressions be automatically interpreted as strings? David
Georgios Thanks for your input. Your code is what I originally had, and I was surprised (and miffed!!) when I tried to print z and it placed a * between the brackets. I want to eventually send output to a text file, using fprintf, so Alec's solution, with a slight modification, should do the trick. I was a little disappointed that there apparently is no flag/parameter in printf to alter the output. I am using ver 7 - I am surprised that later versions haven't incorporated this. Regards David
Georgios Thanks for your input. Your code is what I originally had, and I was surprised (and miffed!!) when I tried to print z and it placed a * between the brackets. I want to eventually send output to a text file, using fprintf, so Alec's solution, with a slight modification, should do the trick. I was a little disappointed that there apparently is no flag/parameter in printf to alter the output. I am using ver 7 - I am surprised that later versions haven't incorporated this. Regards David
Thanks Alec. Your solution works fine, (as expected.) I thought I vaguely understood what it was doing until I altered your code - just by omitting the * between the brackets in the z expression. I was half expecting a syntax error, but it gave some output. (Have also inserted whattype(z);) Have looked up type in the Help section which gives these examples: > type(x+x,`+`); false > type(x+x,`*`); true It states: (x-1)/2is actually of type `+`, rather than `*`, since the expanded form of the expression is 1/2 x -1/2 ...which I must admit I find a little baffling. If there's a simple, explainable answer I'd like to hear it. David #Maple code: printf1:=()->printf("%s",StringTools:-SubstituteAll(sprintf(args),"*","")): z:=(2*x-1)(3*x-2): whattype(z); printf1("%a",z); Outputs + 2x(3x-2)-1
Thanks Alec. Your solution works fine, (as expected.) I thought I vaguely understood what it was doing until I altered your code - just by omitting the * between the brackets in the z expression. I was half expecting a syntax error, but it gave some output. (Have also inserted whattype(z);) Have looked up type in the Help section which gives these examples: > type(x+x,`+`); false > type(x+x,`*`); true It states: (x-1)/2is actually of type `+`, rather than `*`, since the expanded form of the expression is 1/2 x -1/2 ...which I must admit I find a little baffling. If there's a simple, explainable answer I'd like to hear it. David #Maple code: printf1:=()->printf("%s",StringTools:-SubstituteAll(sprintf(args),"*","")): z:=(2*x-1)(3*x-2): whattype(z); printf1("%a",z); Outputs + 2x(3x-2)-1
Hi Thanks for your solution. I thought there might be two methods of solving this: 1. Manipulate the string expression (as you have done) or 2. Use the parameters, flags etc in the printf to modify the output. Am I right in thinking that option 2 is not possible? Regards David
Hi Thanks for your solution. I thought there might be two methods of solving this: 1. Manipulate the string expression (as you have done) or 2. Use the parameters, flags etc in the printf to modify the output. Am I right in thinking that option 2 is not possible? Regards David
William Info you requested: Web Browswer: IE Browswer Version #: Version 6.0.2900.2180.xp.sp Operating System: Windows XP Ver 5.1 (Home edition) 2002 Screen Resolution: 1024 x 768 Color quality: Highest 32 bit Regards David
. . . or just look up Table in the Help section. Calling Sequence table( F, L ) Parameters F - (optional) the indexing function L - (optional) list or set of initial table entries As an example: T := table(symmetric,[]); T[1,1]:=1: T[1,2]:=3: T[2,1]; Maple output T := table(symmetric, []) 3 However, I can't see anything to state or describe the size of the table. And is there a difference between a matrix and a table? David
Page 1 of 1