Is this 9th-level spell Find Greatest Steed balanced with respect to other 9th-level spells?

Since the paladin gets the spells find steed and find greater steed, it only seemed natural to take this theme to its logical end: find greatest steed:

FIND GREATEST STEED
9th-level conjuration

Casting Time: 10 minutes
Range: 30 feet
Components: V, S
Duration: Instantaneous

You summon a spirit that assumes the form of the loyalest, majestic-est mount. Appearing in an unoccupied space within range, the spirit takes on a form you choose: a unicorn, a bulette, a felidar, or a nightmare. The creature has the statistics provided in the appropriate statblock for the chosen form, though it is a celestial, a fey, or a fiend (your choice) instead of its normal creature type. Additionally, if it has an Intelligence score of 7 or lower, its Intelligence becomes 8, and it gains the ability to understand one language of your choice that you speak.

You control the mount in combat. While the mount is within 1 mile of you, you can communicate with it telepathically. While mounted on it, you can make any spell you cast that targets only you also target the mount.

The mount disappears temporarily when it drops to 0 hit points or when you dismiss it as an action. Casting this spell again re-summons the bonded mount, with all its hit points restored and any conditions removed.

You can’t have more than one mount bonded by this spell or find steed at the same time. As an action, you can release a mount from its bond, causing it to disappear permanently.

Whenever the mount disappears, it leaves behind any objects it was wearing or carrying.

A mount summoned with this spell cannot take legendary actions. If it normally would have legendary actions, on its turn, it can use its action to take one of its legendary actions.

A paladin can cast this spell consuming two 5th-level spell slots, instead of one 9th-level spell slot.

This spell would appear only on the Paladin spell list, and could be prepared and cast by a paladin once the paladin was 19th-level. Additionally, this spell would be available to an 18th level Bard via magical secrets. I think this spell only being available to 18th level and higher characters is going to be enough to balance it. Compared to true polymorph, the effects here actually seem pretty modest for a 9th level spell; and for the paladin, casting is always going to be limited to once per long rest, as it uses up all of their highest level spell slots.

The mounts I have chosen range from CR 3 to CR 5. The original 2nd-level spell find steed mounts range from CR 1/8 to CR 1/2, and the now penultimate 4th-level spell find greater steed provides mounts ranging from CR 1 to CR 2. These two spells are given a comparative analysis in this answer. This CR 3-5 range seems like an appropriate increase in power, but as with both its predecessors, some of these greatest steeds will be less greatest than others. I’ve carefully chosen four creatures for this spell, I feel that each brings something unique to the table, even though one of them seems to be a head above the rest. Speaking of which…

The Unicorn (CR 5)

If I’m being totally honest, this spell could have been called find unicorniest steed. The unicorn is easily the best mount on the list. It is not the best damage dealer, not even close, but the utility and support the unicorn provides is unparalleled by other creatures on this list. It can cast pass without trace at will, and its ability healing touch is equivalent to a 2nd-level cure wounds twice a day.

The unicorn is the only creature on the list with legendary actions. I felt that giving the unicorn unbridled access to its legendary actions was too much. Additionally, its just easier to keep track of things when I’m not keeping up with my own turn, my mount’s turn, and legendary actions for my mount on other turns. Instead, the unicorn can opt to use one of its legendary actions on its turn. In particular the unicorn’s shimmering shield ability is quite good, and allows the unicorn to excel in its support role.

The Bulette (CR 5)

This guy is the bruiser of the group. At +7 to hit for 4d12+4 damage, the bulette’s bite attack hits like a truck, and AC 17 averaging 93 hp gives him respectable staying power. The bulette really gets interesting with his movement: burrow 40 ft. If you’re nostalgic about catching your first diglet in a cave outside of Vermilion City, the bulette is for you.

The Felidar (CR 5)

The felidar packs a similar punch to the bulette with identical AC and hitpoints, but the felidar is for the more psychically minded adventurer. The felidar has the ability to form a special bond with another creature, granting these benefits:

  • The felidar can sense the direction and distance to the bonded creature if they’re on the same plane of existence.

  • As an action, the felidar or the bonded creature can sense what the other sees and hears, during which time it loses its own sight and hearing. This effect lasts until the start of its next turn.

Similar combat prowess as the bulette, but has some interesting abilities that make the felidar an excellent scout and great insurance policy if his owner gets kidnapped.

The Nightmare (CR 3)

This goth version of the pegasus features an ability that makes it better than his winged celestial brother, earning him a spot on this list. For the most part, the nightmare is identical to the pegasus, which makes him probably the weakest choice on this list. But the nightmare has one ability the earns him his place here:

Ethereal Stride. The nightmare and up to three willing creatures within 5 feet of it magically enter the Ethereal Plane from the Material Plane, or vice versa.

This guy can disappear to the ethereal plane at will. And he can bring his three closest friends. The utility of this ability is limited only by your imagination and how annoyed your DM is that your flaming horse can walk through walls.

Find the probability of occurrence of each edge in a graph having $n$ nodes after $k$ operations

Given a graph with $ n$ nodes . The adjacency matrix of the graph is given. We do $ k$ operations on this graph. In each operation we choose two distinct nodes $ i$ and $ j$ (there are $ (n*(n-1))/2$ such choices) equiprobably (all choices are equiprobable) and if there exists a edge between $ i$ and $ j$ we delete that edge or else we draw an edge between the chosen pair of nodes.
We have to output a $ n*n$ matrix where the element at $ (i,j)th$ position denotes the probability of occurrence of edge connecting the nodes $ i$ and $ j$ in the final resulting graph.
The constraints on n and k are $ n<=50$ and $ k<=50$ .
I tried it using dynamic programming but could figure out transitions properly.
Can you please help me out.

Find two disjoint set

Given an universum $ U$ and two sets $ A$ and $ B$ of sets of elements from $ U$ . I want to find (if such a pair exists) $ a \in A$ and $ b \in B$ : $ a \cap b \equiv \emptyset$ . Currently I can do it only in $ O(|A| \cdot |B|)$ , is there way to improve this? $ |a|, |b| \leq 32, a \in A, b \in B$ .

Find path of file on website with randomized string in it

Users have the possibility to upload a sensitive personal file to a specific website. After uploading, only the user himself and the administrator of the website have the ability to download the file again.

All files of any user are uploaded to the following folder: https://example.com/folder/uploads/.

Before a file is uploaded, it gets renamed to <<username>>.docx.

So for Foo the path would be: https://example.com/folder/uploads/foo.docx and for Gux it’d be https://example.com/folder/uploads/gux.docx.

As you can see, this is not safe at all. Foo could simply examine the download link, and replace his own name in the file-path with the username of other users to download their files.

So to prevent this, the web-developer did the following: Before a file is uploaded, a random string of 15 characters gets prepended to the filename. This random string is different for each upload.

For Foo this would be for example https://example.com/folder/uploads/heh38dhehe83ud37_foo.docx and for Gux https://example.com/folder/uploads/abcnjoei488383b22_gux.docx.

When Foo examines the download-url, he will know in which folder all the files are stored. But there is no way that he could guess the random string that is prepended to Gux’ file. The random string actually functions as a 15-character long password.

In all directories an index.html-file is placed so the directory content does not get listed.

If Foo still wanted to download other users their files, how would he do that? I’m looking for a way Foo would do this by forming a specific URL or HTTP-request. Breaching the server or database is a correct answer but not the kind I’m looking for.

TL;DR: How to find the path of a file on a public website with a unique and randomized string in it? You know the path to the upload-folder, but there is a index.html-file there so you can’t see the content.

Find number of ways to create sequence $A$ of length $n$ satisfying $m$ conditions

Find number of ways to create sequence $ A$ of length $ n$ satisfying $ m$ conditions. This sequence $ A$ should consist of only non negative numbers. Each condition is described by three integers $ i,j,k$ signifying $ max$ ($ A_{i}$ ,$ A_{j}$ )=$ k$ .
It is guaranteed that each index of the sequence will be there in at least one condition i.e. there will be finite number of such sequences.
The maximum value of $ n$ will not exceed $ 18$ and maximum value of $ k$ will not exceed $ 2*10^4$ .
I tried it using dynamic programming but the time complexity came out to be exponential. Can you suggest me any better approach which will reduce the time complexity?

Find number of ways to create sequence $A$ of length $n$ satisfying $m$ conditions

Find number of ways to create sequence $ A$ of length $ n$ satisfying $ m$ conditions. This sequence $ A$ should consist of only non negative numbers. Each condition is described by three integers $ i,j,k$ signifying $ max$ ($ A_{i}$ ,$ A_{j}$ )=$ k$ .
It is guaranteed that each index of the sequence will be there in at least one condition i.e. there will be finite number of such sequences.
The maximum value of $ n$ will not exceed $ 18$ and maximum value of $ k$ will not exceed $ 10^6$ .
I tried it using dynamic programming but the time complexity came out to be exponential. Can you suggest me any better approach which will reduce the time complexity?

Given an array $a$, we have to find product of $a_{j}$-$a_{i}$ modulo $998244353$ over all $i$ and $j$ given $j>i$

Given an array $ a$ , we have to find product of $ a_{j}$ $ a_{i}$ modulo $ 998244353$ over all $ i$ and $ j$ given $ j>i$ .
For eg. Let the array be $ 1,2,3$ then my answer will be calculated as-
$ (2-1)$ .$ (3-1)$ .$ (3-2)$ =$ 2$
As number of elements in the array could be large (upto $ 10^5$ ) I am looking for solution of order $ nlogn$ .
I have tried representing array as a polynomial but could get anything out of it. Please help.

Is there any good method to find if a grammar is optimal for a problem?

I’ve been thinking about grammatical evolution problems and how the grammar influences the algorithm performance. It came to my mind the huge impact that the grammar that you’re using has in the time that takes an algorithm to reach an optimum solution.

The simplest example would be if your problem doesn’t involve trigonometric operations. If you’re trying to find f(x) = 3x - 1/2, including sins, tangents or square roots in your grammar will, almost certainly, slowen your algorithm as the population complexity will grow. Other not-so-evident simplifications for a grammar would be trigonometric identities:

tan(x) = sen(x) / cos(x) 

Talking about this last example, I don’t know how to determine the importance of the impact of including tan(x) between the grammar rules to produce valid solutions. Or in other words, knowing if adding tan(x) will be better in terms of performance than don’t doing it and thus, forcing the evolution to combine two or more operators and terminals to being able to use that operation and making the grammar ambiguous.

So this two are the questions:

  1. Is there any way of knowing if a grammar is optimal for finding a solution?
  2. Which evolutionary algorithm or machine learning method (considering that I’m almost profane in this discipline, some explanation is wellcome) would you use for finding optimal or sub-optimal grammars?

Thanks

How to find the size of gaps between entries in an array so that the first and last element of the array is filled and the gaps are all of equal size?

I have an array a of n entries. I need to place a token on the first and last position of that array, so a[0] = 1 and a[n-1] = 1.

I now want to place additional tokens into that array with a distance inbetween each index i where a[i] = 1 that is greater than 2 (so placing a token on every index is invalid as well as alternating using and not using an entry is invalid). Phrazed differently: I want that sum(a) < n/2 . The gap inbetween each token should be the same, so say with an array of size 16,

a[0] = 1, a[3] = 1, a[6] = 1, a[9] = 1, a[12] = 1, a[15] = 1

would be a solution with a gap size of 2 (distance of 3).

How do I find all gap sizes that are possible to fill said array with the given constraints?

Imagine a street inbetween two crossroads where a lamppost should be placed on each crossroad and then additional lampposts should be placed equidistant to each other and for some reason only natural number distances are allowed.

(The actual problem I want to solve is where to place Sea Lanterns in my Minecraft Project so do not disregard this problem as an assignment question I want a solution for.)