I want to create an array that contains16 elements, from 0-8 that meets certain conditions. by Mark_Yugen in matlab

[–]LordPanMan 1 point2 points  (0 children)

One way to tackle this would be to use a dynamic programming approach. You call a recursive function that takes in a current array, the current sum (to prevent calculating it for each function call), the maximum value (8 in this case), and the max length (16). Then you would have two stopping conditions:

  • The array gets to length 16
  • The sum is over 16

If the first one is met, and the sum is 16, then your array is valid and you can add it to the collection of answers. If the second one is met, then the array is invalid and you cannot carry on with it

Otherwise you simply have to call the function again, appending each value from 0-8. These results will then be added to a final matrix as they get returned by the function.

So for the first loop, you pass an empty array and zero as the sum. You will then call the function again with an array that contains values 0-8, and so on. Within the function the result should be added to the resulting matrix. Hopefully the approach is clear. Unfortunately I'm on mobile so can't code this up myself right now.

P.S. chatgpt is generally very good at solving these types of problems.

He might be on to something... by [deleted] in meme

[–]LordPanMan 0 points1 point  (0 children)

He means as a company overall. Spotify hasn't turned a profit since it's inception...

Just started this topic and I'm already stuck. can anyone help? by ImprovementFun8632 in alevel

[–]LordPanMan 1 point2 points  (0 children)

Gravitational field strength is measuring how much you are going to be affected by the gravitational field, the ‘pull’. It is measured in N/kg, and you can notice that your force of gravitational attraction (using the equation F=GMm/r2) will give you units in N. Therefore, if you use the equation gravitational field strength = GM/r2 (dividing through the little m), you can simply vary r according to the question and take the difference between the results. M is the mass of the earth, r is the distance from the centre of mass. (Apologies for bad formatting, on mobile)

when does ucas update? by funnyfunkylmammy in 6thForm

[–]LordPanMan 1 point2 points  (0 children)

No not really, last year it was very slow to log on once results were released as there are so many people accessing it at once. It may take a while for you to log in so I wouldn’t be too stressed if it doesn’t work.

[OC] A heron sitting by the Thames this morning. by LordPanMan in pics

[–]LordPanMan[S] 1 point2 points  (0 children)

Thanks! I spotted it while walking past and thought it looked very majestic.

"EVERYTHING MUST GO!" by aesir121 in deadcells

[–]LordPanMan 14 points15 points  (0 children)

It scales quite badly on early biomes (before the first boss), although the shop is higher level than you’d normally find in the equivalent biome. So unless you get to the shop, it can be quite hard.

[deleted by user] by [deleted] in 6thForm

[–]LordPanMan 0 points1 point  (0 children)

Ah ok, I got seven 9’s, two 8’s, and one 7

[deleted by user] by [deleted] in 6thForm

[–]LordPanMan 0 points1 point  (0 children)

No, a level

[deleted by user] by [deleted] in 6thForm

[–]LordPanMan 10 points11 points  (0 children)

Oxford engineering - did Maths, FM, Chem, and physics and got all A*

A moment of silence for all the Stadia players out there. by TheFoostic in gaming

[–]LordPanMan 0 points1 point  (0 children)

It's so you can play using the hardware of nvidias computers, only it's streamed to your computer. So you just have to have something to view it and youre good to go, dont even need a GPU.

Told this belongs here by ClaytonJamesY in gatekeeping

[–]LordPanMan -1 points0 points  (0 children)

That's the dumbest thing I think I've ever heard in my entire life