acer

32353 Reputation

29 Badges

19 years, 331 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer


 

restart;

msg:="Picturesque meant - he decided after careful observation of the scenery that inspired Twoflower to use the word - that the landscape was horribly precipitous. Quaint, when used to describe the occasional village through which they passed, meant fever-ridden and tumbledown. Twoflower was a tourist, the first ever seen on the Discworld. Tourist, Rincewind had decided, meant 'idiot'.";

"Picturesque meant - he decided after careful observation of the scenery that inspired Twoflower to use the word - that the landscape was horribly precipitous. Quaint, when used to describe the occasional village through which they passed, meant fever-ridden and tumbledown. Twoflower was a tourist, the first ever seen on the Discworld. Tourist, Rincewind had decided, meant 'idiot'."

Elg_encrypt:=proc(s::string, r::posint,
                  p::posint, a::posint, b::posint)
  local hkt, L;
  if not r <= p-1 then
     error "r must be strictly less than p";
  end if;
  hkt := `mod`(a &^ r, p);
  L := convert(msg, bytes);
  return hkt, map( u->`mod`(u*b&^r, p), L );
end proc:

header,ciphertext:=Elg_encrypt(msg,20000000000,14654455471,
                               457454,13954306945):

Error, (in Elg_encrypt) r must be strictly less than p

header,ciphertext:=Elg_encrypt(msg,532123,14654455471,
                               457454,13954306945):

header;

9681348997

ciphertext;

[12432485341, 2579085006, 13736574369, 4105371047, 9573017222, 7824534168, 10017411248, 13292180343, 2356887993, 9573017222, 10017411248, 13765667419, 9795214235, 10017411248, 2801282019, 608404939, 4105371047, 13765667419, 11572790339, 13765667419, 11765894302, 10017411248, 13765667419, 4549765073, 10017411248, 13736574369, 2579085006, 4549765073, 10017411248, 4549765073, 13765667419, 2801282019, 830601952, 4105371047, 10017411248, 7824534168, 13765667419, 13736574369, 2801282019, 7824534168, 10017411248, 830601952, 9573017222, 4327568060, 13765667419, 6076051114, 8268928194, 13292180343, 10017411248, 7824534168, 386207926, 2801282019, 4105371047, 2579085006, 6076051114, 608404939, 13765667419, 6076051114, 830601952, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 13292180343, 13736574369, 10017411248, 608404939, 10017411248, 7824534168, 2134690980, 13765667419, 4105371047, 11765894302, 2801282019, 4105371047, 13765667419, 2579085006, 608404939, 13292180343, 11543697289, 2579085006, 7824534168, 10017411248, 4549765073, 13765667419, 4994159099, 5853854101, 6076051114, 830601952, 4327568060, 6076051114, 5853854101, 10017411248, 7824534168, 13765667419, 4105371047, 6076051114, 13765667419, 9573017222, 13292180343, 10017411248, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 5853854101, 6076051114, 7824534168, 4549765073, 13765667419, 11572790339, 13765667419, 4105371047, 11765894302, 2801282019, 4105371047, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 4327568060, 2801282019, 608404939, 4549765073, 13292180343, 13736574369, 2801282019, 11543697289, 10017411248, 13765667419, 5853854101, 2801282019, 13292180343, 13765667419, 11765894302, 6076051114, 7824534168, 7824534168, 2579085006, 8268928194, 4327568060, 2134690980, 13765667419, 11543697289, 7824534168, 10017411248, 13736574369, 2579085006, 11543697289, 2579085006, 4105371047, 6076051114, 9573017222, 13292180343, 2385981043, 13765667419, 3245676045, 9573017222, 2801282019, 2579085006, 608404939, 4105371047, 6105144164, 13765667419, 5853854101, 11765894302, 10017411248, 608404939, 13765667419, 9573017222, 13292180343, 10017411248, 4549765073, 13765667419, 4105371047, 6076051114, 13765667419, 4549765073, 10017411248, 13292180343, 13736574369, 7824534168, 2579085006, 8268928194, 10017411248, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 6076051114, 13736574369, 13736574369, 2801282019, 13292180343, 2579085006, 6076051114, 608404939, 2801282019, 4327568060, 13765667419, 386207926, 2579085006, 4327568060, 4327568060, 2801282019, 6298248127, 10017411248, 13765667419, 4105371047, 11765894302, 7824534168, 6076051114, 9573017222, 6298248127, 11765894302, 13765667419, 5853854101, 11765894302, 2579085006, 13736574369, 11765894302, 13765667419, 4105371047, 11765894302, 10017411248, 2134690980, 13765667419, 11543697289, 2801282019, 13292180343, 13292180343, 10017411248, 4549765073, 6105144164, 13765667419, 9795214235, 10017411248, 2801282019, 608404939, 4105371047, 13765667419, 830601952, 10017411248, 386207926, 10017411248, 7824534168, 11572790339, 7824534168, 2579085006, 4549765073, 4549765073, 10017411248, 608404939, 13765667419, 2801282019, 608404939, 4549765073, 13765667419, 4105371047, 9573017222, 9795214235, 8268928194, 4327568060, 10017411248, 4549765073, 6076051114, 5853854101, 608404939, 2385981043, 13765667419, 4994159099, 5853854101, 6076051114, 830601952, 4327568060, 6076051114, 5853854101, 10017411248, 7824534168, 13765667419, 5853854101, 2801282019, 13292180343, 13765667419, 2801282019, 13765667419, 4105371047, 6076051114, 9573017222, 7824534168, 2579085006, 13292180343, 4105371047, 6105144164, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 830601952, 2579085006, 7824534168, 13292180343, 4105371047, 13765667419, 10017411248, 386207926, 10017411248, 7824534168, 13765667419, 13292180343, 10017411248, 10017411248, 608404939, 13765667419, 6076051114, 608404939, 13765667419, 4105371047, 11765894302, 10017411248, 13765667419, 5438553125, 2579085006, 13292180343, 13736574369, 5853854101, 6076051114, 7824534168, 4327568060, 4549765073, 2385981043, 13765667419, 4994159099, 6076051114, 9573017222, 7824534168, 2579085006, 13292180343, 4105371047, 6105144164, 13765667419, 8713322220, 2579085006, 608404939, 13736574369, 10017411248, 5853854101, 2579085006, 608404939, 4549765073, 13765667419, 11765894302, 2801282019, 4549765073, 13765667419, 4549765073, 10017411248, 13736574369, 2579085006, 4549765073, 10017411248, 4549765073, 6105144164, 13765667419, 9795214235, 10017411248, 2801282019, 608404939, 4105371047, 13765667419, 8075824231, 2579085006, 4549765073, 2579085006, 6076051114, 4105371047, 8075824231, 2385981043]

 


 

Download elg_encrypt.mw

@Gibberish123 

@Christopher2222 

foobar := eval(:-changecoords)

@nk2016 

plots:-display(Array( [ [ P1, P2 ], [ P3, P4 ] ] ) );

 

@Gibberish123 The procedure rsa you show expects its second argument to be a list. So why are you trying to call it like rsa(26271227347, 11393739244) where the second argument is a scalar?

The fact that your function call to rsa returned unevaluated indicates that you have not actually made the assignment of the procedure you show (in an image, sigh) to the name rsa I suggest that you switch from 2D Input to 1D Maple Notation input, and from Document to Worksheet. See the GUI Options/Preferences.

Your procedure uses the name message. Where would that be defined? Your procedure has a parameter msg. Is the former a typo?

Your keys are very small.

Why do you ignore my suggestion to use the efficient syntax modp(Power(num,e), n) instead of the inefficient num^e mod n syntax?

Your technique of repeated list augmentation is inefficient. You could just use seq (or map) to operate over the elements of list msg, and have it be both more efficient and terse and understandable.

@Gibberish123 I don't understand why you want to do have argument msg be a list. And isn't `message` a typo for `msg`.

You seem to be ignoring everything I wrote before, as well as using several anachronistic maple programming syntax elements. It is hard to help when you don't respond directly to questions or suggestions.

Please don't repost this as yet another duplicate question, just because nobody has answered here. 

@Ronan No, there is a bug in plottools:-line that it works with unassigned names in the data. It should throw an error line `point` does. That's my opinions, anyway. Better is to delay evaluation, as I showed.

How about checking that dy/dx = 1/(-tan(t*(n+1)/n)) and consider when the denominator of that tends to zero? How often can that occur, given the bounds on t?

@vv Yes, I agree. I do not know offhand whether the following discrepancy is by design or oversight.

plottools:-line([0, 0, 0],[a,b,c]);
                   CURVES([[0., 0., 0.], [a, b, c]])

plottools:-point([a,b,c]);          
Error, (in plottools:-point) incorrect arguments for creating
 points structure, try providing the dimension option

plottools:-point([a,b,c],dimension=3);
Error, (in Plot:-Structure:-Points) points cannot be converted
 to floating-point values

@vv I gave three ways of doing it: using either unevaluation quotes, or the animate syntax (which splits command and its args), or both. Each of the three pairs (for line and point) have both calls being similar. No special difference as far as one (of the pair) goes versus the other,

I did this to contrast with your suggestion to use POINTS instead of point, which of course is indeed a special difference.

I suggest, therefore, that preventing premature evaluation (here, at least) by using uneval-quotes can work with a more consistent methodology than does replacement of command-name or use of internal structures. It's not alays true, but it is here, and often is.

@vv 
 

restart;

a := 21*arccos(RootOf(448*_Z^7+192*_Z^6-784*_Z^5-288*_Z^4
                    +392*_Z^3+108*_Z^2-49*_Z-6, index = 2))/Pi;

21*arccos(RootOf(448*_Z^7+192*_Z^6-784*_Z^5-288*_Z^4+392*_Z^3+108*_Z^2-49*_Z-6, index = 2))/Pi

b := -(21*I)*ln(RootOf(7*_Z^14+6*_Z^13+6*_Z+7, index = 2))/Pi;

-(21*I)*ln(RootOf(7*_Z^14+6*_Z^13+6*_Z+7, index = 2))/Pi

# The following works, but it's not altogether clear why.
#
evala(convert(convert(a-b,RootOf),arccos));

0

# The reason I say it's not clear is that the above works by
# virtue of turning `a` into the following form.
#
# NB. The conversion of `b` is more clear in this:
#    convert(convert(a-b,RootOf),arccos) + convert(b,arccos)
#
# NB. But that form of `a` is not done by just, say,
#    convert(convert(a,RootOf),arccos)
# which doesn't do anything.
#
simplify(convert(convert(a-b,RootOf),arccos) + convert(b,arccos));

21*arccos(-(1/2)*RootOf(7*_Z^14+6*_Z^13+6*_Z+7, index = 2)^13-(3/7)*RootOf(7*_Z^14+6*_Z^13+6*_Z+7, index = 2)^12+(1/2)*RootOf(7*_Z^14+6*_Z^13+6*_Z+7, index = 2)-3/7)/Pi

# The following turns that into `a`.
# But I would rather have the means to go the other way.
#
evala(Simplify( evalc(%) ));

21*arccos(RootOf(448*_Z^7+192*_Z^6-784*_Z^5-288*_Z^4+392*_Z^3+108*_Z^2-49*_Z-6, index = 2))/Pi

# So here is the first of two other methods to show that a = b .
#
# This works by finding a dependence relationship between
# the RootOfs.
#
evala(Indep(indets(a,specfunc(RootOf))
            union indets(b,specfunc(RootOf)),'s'));
eq := s[1];

false

RootOf(7*_Z^14+6*_Z^13+6*_Z+7, index = 2) = RootOf(-2*_Z*RootOf(448*_Z^7+192*_Z^6-784*_Z^5-288*_Z^4+392*_Z^3+108*_Z^2-49*_Z-6, index = 2)+_Z^2+1)

# The next step actually produces `a` explictly from `b`
# (That is often harder than computing that a - b = 0 and
# so this is much nicer.)
#
radnormal(convert(eval(b,eq),arccos));

21*arccos(RootOf(448*_Z^7+192*_Z^6-784*_Z^5-288*_Z^4+392*_Z^3+108*_Z^2-49*_Z-6, index = 2))/Pi

% - a;

0

# And here is another way to turn `b` into `a` directly.
#
evala(Simplify( evalc(radnormal(convert(b,arccos))) ));

21*arccos(RootOf(448*_Z^7+192*_Z^6-784*_Z^5-288*_Z^4+392*_Z^3+108*_Z^2-49*_Z-6, index = 2))/Pi

% - a;

0

# FWIW...
#
W := op(indets(b, specfunc(RootOf)));

RootOf(7*_Z^14+6*_Z^13+6*_Z+7, index = 2)

evala( evalc(abs(W)) );

1

 


Download conver.mw

[edited] When I say, "not altogether clear why" I mean that `evala` may be looking for the dependence between the RootOfs, so as to return the result having just one as preferred. So perhaps it clarifies by doing it in steps, etc.

@tomleslie By using the combine(...,units) command first you can reduce both sides to common (canonical) units, before stripping them off as unit_free.

See my Answer below, from earlier today.

@Gibberish123 I don't understand what your last Comment is about, sorry.

@Preben Alsholm The last time this occured I used the Mapleprimes Search facility, and then submitted the following as a bug report. I will add this current item.

Here's a full list of my search results, with an attempt at classification:

AB 22/11/2016 http://www.mapleprimes.com/questions/220122-Incomplete-Worksheet
       08/11/2016 http://www.mapleprimes.com/questions/219874-Cant-Open-Saved-Maple-Document
A    12/10/2016 http://www.mapleprimes.com/questions/219045-Maple-Wont-Open-My-File
A    06/10/2016 http://www.mapleprimes.com/questions/218743-There-Was-A-Problem-During-The-Loading
      20/06/2016 http://www.mapleprimes.com/questions/213635-Suddenly-I-Cant-Open-My-Maple-File
      08/06/2016 http://www.mapleprimes.com/questions/213228-There-Were-Problems-During-The-Loading
B    22/05/2016 http://www.mapleprimes.com/questions/212631-Error-When-Loading-Mw-File
A    18/01/2016 http://www.mapleprimes.com/questions/208582-Problem-With-Loading-Mw-File
B    12/12/2014 http://www.mapleprimes.com/questions/203064-Incomplete-Worksheet
       29/09/2014 http://www.mapleprimes.com/questions/202488-There-Were-Problems-During-Loading-Process
A    09/04/2014 http://www.mapleprimes.com/questions/201351-There-Were-Problems-During-The-Loading
       08/05/2012 http://www.mapleprimes.com/questions/133893-File-Open-Errore
       14/02/2012 http://www.mapleprimes.com/questions/130656-There-Where-Problems-During-The-Loading
       09/01/2012 http://www.mapleprimes.com/questions/129478-There-Was-Problems-During-The-Loading-Process
A    06/01/2012 http://www.mapleprimes.com/questions/129377-There-Were-Problems-During-The-Loading
       19/12/2011 http://www.mapleprimes.com/questions/128950-There-Were-Problems-During-The-Loading
A     09/10/2011 http://www.mapleprimes.com/questions/126390-There-Were-Problems-During-Loading-Process
A     09/09/2011 http://www.mapleprimes.com/questions/125503-Incomplete-Worksheet
A     06/09/2011 http://www.mapleprimes.com/questions/125457-There-Were-Problems-During-The-Loading-Process
B     08/03/2011 http://www.mapleprimes.com/questions/102290-HELP-Maple-Worksheet-Wont-Open-Problems
A     01/12/2010 http://www.mapleprimes.com/questions/99712-There-Were-Problems-During-The-Loading-Process
A     27/09/2010 http://www.mapleprimes.com/questions/97218-Incomplete-Worksheet
        09/03/2010 http://www.mapleprimes.com/questions/35559-Incomplete-Worksheet-Lost-File
        10/09/2008 http://www.mapleprimes.com/posts/38707-Maple-Worksheet-Loading-Error
B     25/03/2008 http://www.mapleprimes.com/posts/38707-Maple-Worksheet-Loading-Error

Problem A) Users who seem to be Danish, (opgave, projekt):
Sometimes there are invalid characters present. Eg.
  "PCDATA invalid Char value 3"
  "hj\303\246lp"
  "sammenh\303\246ngen"
  Unicode 0xb a vertical tab
Sometimes the saved file is just a great many zero bytes.

Problem B) Unclosed XML tags (usually following an element with corrupted content):
Could not the GUI close off the pending open tags as well as give the error message about the worksheet being incomplete? That is to say, why does it only show the content from fully closed tags?

I have edited my Comment and deleted a suggestion to divide by N. I stand by the rest of my Comment.

@student_md 

Try plots:-display(p1,p2) .

First 286 287 288 289 290 291 292 Last Page 288 of 592