cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Could you help me to program this one

NM_10165576
11-Garnet

Could you help me to program this one

Hi 
could you help me to program this one?
And the previous generated function works without m to (mod..).
see the picture.

NM_10165576_1-1729229870052.png

 

5 REPLIES 5

It is better to attach your Mathcad Prime worksheet to the message.

 
Werner_E
25-Diamond I
(To:NM_10165576)


@NM_10165576 wrote:

Hi 
could you help me to program this one?


And again you are just posting one single handwritten example and are  not willing to explain in more detail which rules apply to return this output from the given input? Is there anything you tried on your own (apart from retyping Stuart's program)?

Is this homework? Or where does this problem stem from?

 

Can only guess that you are looking for something like this:

 

Werner_E_0-1729269860698.png

Werner_E_1-1729269891442.png

 

StuartBruff
23-Emerald III
(To:Werner_E)

Hah!  I'm supposed to say, "That will teach me to read further down the thread before replying", but I know I'll be lying.  I'd seen your reply earlier on and forgot to scroll down sufficiently far to see if you'd updated it.

 

I'd started to reply to this thread this morning, but, as usual, got distracted by bigger and better things, such as thinking, "A column swop function is just the ticket ... 🤔 ... and maybe a rotate right function to aid in its writing, none of that nasty iteration stuff when a multiplicity of functions will do!  But now that I've started, I may as well generalize the idea to left rotation and row equivalents".  After which, it all too readily spiralled out of control.  🙄

 

Nice use of the iff function, BTW ... although I would have snuck the vectorization inside, of course, albeit at the expense of more globally-warming typing.  😉

 

Stuart

StuartBruff
23-Emerald III
(To:NM_10165576)


@NM_10165576 wrote:

Hi 
could you help me to program this one?
And the previous generated function works without m to (mod..).
see the picture.


 

It's usually more accessible for the reader if you embed the picture directly into your message rather than as a PDF (or do both).   You're also more likely to garner a quicker (and complete) response if you show your attempts to solve the problem or indicate your particular stumbling blocks,

 

As a starter for ten, however ...

 

2024 10 18 A.png

 

An "obvious" pattern from your example is to replace each leading row element of generate with 1 and then "shift" the leading row over to the jth column.   It might be helpful to break this down into smaller steps by creating a submatrix for each kth subgroup of s permutations.   generate2 shows one method of partitioning L.   

 

There are several ways to stitch the partitioned L back into a single matrix (eg, stacking subsequent partitions onto the first).

 

Stuart

 

PS.  Yes, you're right that the 'mod' line was unnecessary.  Sorry about that.  I was playing around with some other idea that caught my fancy, got distracted,  and forgot to remove it.  Mea culpa.

 

The lambda argument to generate2 is just another example of me playing again and wondering if values other than 1 might be interesting.

 

Announcements

Top Tags