1:06 AM
Wasted an hour on my linear algebra homework before the realization that matrix dot product isn't commutative :/

1:23 AM
matrix dot product?
Do you mean an inner product or composition?
If the matrices are over R then their inner product should be commutative

I mean the literal . in Mathematica I don't know the technical term

It is probably composition.

My professor's accent is completely incomprehensible, I'm basically self-taught

Often called multiplication (I think this term is bad though)
If you think of matrices as linear functions of vectors (which you should be), then matrix "multiplciation" is just function composition.

That's exactly what I'm doing now
I just composed the functions backwards
Are you wheat wizard btw

1:33 AM
Which transforms it from a bizarre seemingly arbitrary operation to a meaningful term.
I be them

I have no clue how I guessed that, this is the first time I'm seeing this username/pfp

Highish rep + unfamiliar name = wheat wizard

Yeah :D
I wonder if there's a language out there that overrides multiplication on functions to compose them

Oh It probably ends up on (<>) instead

The impression I got from my little Haskell knowledge is that it doesn't override anything ever

1:43 AM
How did you get that impression?

Anonymous
@Pavel You almost can in JS :P

at least in the Numeric.LinearAlgebra package

@SriotchilismO'Zaic Maybe I just read something wrong and it's been a while ¯\_(ツ)_/¯

Well for the most part Haskell uses a lot of type classes which abstractions quite nice.

I thought that (*) had to have type Num -> Num -> Num and you couldn't do much about that

1:47 AM
It has type Num a => a -> a -> a

My point that type a -> b is not Num stands

Ah but, (Container Matrix a, Num a, Num (Vector a)) => Num (Matrix a)
That is, a matrix of things that are Nums is itself a Num.

Oh, so you still meant actual matrices and not just functions

Oh yes I did.

Also, your blob of a type just completely lost me

1:50 AM
Yeah it is easier to break it up
the first one Container Matrix a is just fluff and only very technically neccessary
Then next one is Num a or in english a is a Num,

and a is a Vector, and a Vector is a Num?

Not quite
Num (Vector a) means a Vector of as is a Num.

Ah
So is this also defining the Vector type at the same time?

It is not
that is defined elsewhere

But you can still give it additional is-a relationships from within a different type definition???

1:53 AM
This is actually an instance declaration so it doesn't define any types, it just gives the compiler a template for making certain types.

Like a generic type in other languages?

@Pavel Thinks on the left hand side are preconditions, that is they are things required to be true for the right hand side to be true.
@Pavel Roughly speaking yes

Ah, got it. The precondition explanation clears it up a lot
If a is a Num, and a Vector of as is a Num, then a Matrix of as is also a Num

Yes
You could write an instance declaration of function composition as *.
I think

Now because the definition of (*) is (Num a) => a -> a -> a, all those as have to be the same, so you couldn't, for example, override multiplication to multiply a matrix and a scalar?

1:59 AM
Oh I misunderstood
@Pavel Yes you cannot get scalar "multiplication" with (*) from Num
This is because Num is actually representative of a structure called a ring in algebra, and scalar multiplication is not a ring
In fact I don't like calling scalar multiplication "multiplication" because I think it is misleading, but it is the prevailing term.

It's actually mapping scalar * scalar multiplication over a 2D array. There's probably a name for this.

It can be thought of a little more generally than that.
If a matrix is a linear function, It is multiplying the result of that function by some value

So for matrix A * scalar s, we can think of scalar multiplication as the composition of (s*) and A

Yes
Importantly this allows us to do it over black box functions.

ooh

2:07 AM
It also might be a neat exercise to prove that this is the case.

So what branch of mathematics is this?
Maybe in a few years I'll be able to take a class on it

Linear algebra

Is there a more specific term

Not really

Because linear algebra is what I'm studying now and I don't think we have the concept of black box functions anywhere

2:09 AM
Linear algebra is a pretty big field and this is sort of the more basic stuff.

Just linear transformations

Well any linear transformation of finite dimension can be represented by a matrix, so you can actually un-blackbox linear transformations
If you want to get into the infinite dimension stuff that would be called Functional Analysis
If you don't mind me asking is this a high-school course or a uni course?

At my uni it's Math 220 - Introductory Linear Algebra
Functional Analysis sounds cool

I never took it, since the prof teaching it passed away, but I touched on it pretty heavily in Real Analysis II
Linear algebra is quite fun though

This is actually my first ever university math course, it's basically exactly like any high school course I've ever had, in the sense that the teacher drones on in the most boring and incomprehensible way while all the actual learning and assignments happen via a pearson online textbook

2:14 AM
That's unfortunate.
In my experience most of my introductory classes were kind of like that

So you tell me about all these absolutely fascinating concepts, and then I discover that actually, they're all basics of the exact subject I'm studying right now

The advice I always give is to take the most advanced classes you possibly can even in stuff you might think you are bad at or not interested in. The professors tend to be more passionate about it and the class sizes tend to be smaller. It makes it more enjoyable and as a consequence often easier.
@Pavel It might have been misleading for me to phrase it that way. Most intro courses to Linear Algebra focus on the useful bits rather than the basic bits. You can teach a lot of the useful stuff without touching on the underlying mathematical abstractions that are essential to mathematicians, but essentially useless to an engineer.

I actually have surprisingly few math requirements for my CS major

I had surprisingly few math requirements for my math major

I have this linear algebra course, an introductory logic course, a more advanced logic course, and some calculus that I already completed in high school

2:21 AM
At my uni logic counted as a humanities course rather than a math course.

At mine the introductory one counts as philosophy and the advanced one is actually math

It was actually quite similar for me, more advanced ones got cross-listed into math and CS

Oh and Discrete Structures
Forgot about that one because I have no idea what that might mean

My guess would be that it is a discrete math course.
Discrete math is basically just a branch of CS

I still don't know what that is
Ah

2:24 AM
Does your uni have separate CS and CE majors?

Yeah

Yeah so discrete math is the really CS stuff.
In my discrete math course I wrote no code.
Well I wrote my homeworks in LaTeX but you get the idea.

So like automata theory and stuff?
That's what I think of when you say "Computer science but not the coding part"

Yeah pretty much

I just looked at the CE requirements, it sounds bloody awful

2:27 AM
It also for me had a lot of the proof technique + logic stuff thrown in, but if CS majors are required logic then it might not play as heavily

You have to take art classes in user interface design

I like to point out that while at uni I was introduced to basic logic in 6 different courses.

I found the actual name of the "more advanced logic", it's "Introduction to Mathematical Reasoning"

Ah see to me more advanced logic actually meant something a little bit different from that.

Well introducion to logic is literally just basic predicate logic
We learned what a truth table is last friday

2:33 AM

Apparently the direct continuation of my current logic course is basic propositional logic

Ah yeah that would be the sort of course I was expecting.

This is what I assumed mathematical reasoning would end up being
So basically, course descriptions are only useful once you've already taken the class

4 hours later…
6:20 AM
-5

Online Classes For Science 0120-4150125 by Career Dose helps students to learn the subject in the most effective way and it helps to develop logical thinking in them. Our tutorials are made in such a way that they are easy to understand. Our content is created by the professionals who are expert ...

1 hour later…
7:40 AM
0

This is my first question in Code golf I found it in stack-overflow (originally in JavaScript however all languages are acceptable): Render on screen NxN (where N in range 1-16) grid where each cell have black boundary and red number - cells are numerated in hex starting from left-upper corner t...

8:20 AM
-1

Task: write in any language which can generate images e.g. JavaScript, the smallest "put pixel" function. You can initialise screen inside that function or in separate code. The put-pixel function should consume 6 arguments: x,y,r,g,b,a where x,y pixel coordinates and r,g,b,a are color values (a ...

posted on September 18, 2019 by ledbillboard

China LED Screen Suppliers generate heat during use, especially for outdoor LED display. Because the environment used for it requires very high brightness, it should be above 4000CD, so the heat generated is very large. In practical applications, the LED display is improved. The heat dissipation not only effectively improves the efficiency of the heat dissipation of t

9:02 AM
0

Smallest put pixel function Task: write in any language which can generate images e.g. JavaScript, the smallest "put pixel" function. You can initialise screen inside that function or in separate code. The put-pixel function should consume 6 arguments: x,y,r,g,b,a where x,y pixel coordinates and...

1 hour later…
10:06 AM
Petition to storm Area51.SE with random posts on 20th September. They can't flag us all.
Anyone down?

10:24 AM
goodbye, see y'all on 20th

2 hours later…
12:09 PM
@Arjun Gotta clap moderator cheeks

1 hour later…
1:22 PM
0

Calculate the Ultraradical code-golfnumber What is the Ultraradical The ultraradical, or the Bring radical, of a real number \$a\$ is defined as the only positive root of \$x^5+x+a=0\$. The notation is \$BR(\cdot)\$. For example, \$BR(-100010)=10\$, since \$10^5+10-100010=0\$. Challenge Writ...

1:40 PM
1

Can you imagine solving the NYT crossword puzzle without any clues? Maybe not with all of the creativity and new words and phrases appearing in modern crosswords, but with a fixed word list there's some hope. In this challenge, you create a crossword puzzle grid in which this is theoretically p...

2:00 PM
0

INTRODUCTION I like Karma Fields : he's a music producer that creates original music tracks. His artwork also matches up really well his style. He has a logo witch I find really interessing : GOAL Your goal will be to reproduce that logo, graphically or in ASCII. RULES The logo can be an...

1 hour later…
3:20 PM
1

When making phone calls internationally, phone numbers are prefixed with a code indicating what country the number is located in. These codes are prefix codes, meaning that no code is a prefix of another. Now, earlier today you missed a call, and you're kind of curious where that call might have...

1 hour later…
4:25 PM
For this question:
8

This challenge will have you count "creatures" in the tile game Palago. A creature is any closed shape that can be formed by Palago tiles of matching colour in a hexagonal grid. The game Palago consists of tiles like this: These tiles can be rotated \$120^\circ\$, \$240^\circ\$, or not a...

The intent appears to be that we're supposed to actually calculate the output via some in-memory process of virtually fitting shapes together or something
But it appears we can produce valid output via a simple lookup table, because the range of inputs is so small (n between 1 and 10)
Is this a valid strategy? Should the question exclude that option, and if so, how exactly would you go about excluding that pretty obvious strategy in answers?

1 to 10 is required to complete on TIO, but it appears that any input is valid, so unless you have a very large lookup table I don't think that approach would work.

so, input is not limited to n<=10. I don't understand why it was mentioned at all then
So you're suggesting he actually meant "your (presumably complex) code has to accept all inputs, but for the purpose of online testing on TIO, I'm only requiring that you ensure that values under 10 complete in a reasonable time"
(because of some possible constraints on TIO speed or allowed complexity)

It's a method of eliminating a complete brute-force approach that simply enumerates all possible tilings. There are other challenges that have a similar time restriction.

4:42 PM
I still think we'd need a fixed range of valid n; according to the estimate page the numbers get impractical to calculate for n>20
In which case we're back to the original question: can I return a value from a lookup table, unless/until the author adds "you can't just return a value from a lookup table" to the original question?

@BradC In general, that's kind of a tacky add on that doesn't really fix the problem. If a question can be solved by a lookup table, it's usually a bad question (unless it's a kolmogorov complexity question), and saying "don't hardcode answers" is kinda subjective (what if I hardcode some of them to make it simpler, etc.). That's an even bigger problem for challenges.
But in this case, a lookup table doesn't solve the question. Even if it becomes impractical for n>20, your algorithm must work for any n, which is pretty easy to prove a lookup table doesn't.

@DJMcMayhem Except that "it must work for any n" might mean "it can toil away forever and not return a value" for n>20?
I'm still not seeing that is a precise specification
Depends on what your definition of "work" is
So I think I'm agreeing with your first sentence, that because this question requires a "you can't just use a lookup table", this isn't a great question

@BradC 9 hours is very different than "toil away forever"

Maybe its an interesting abstract programming experiment, but not a great challenge

Obviously, some n's are so impractical that you'll never see your program finish for them, but that doesn't mean they can't finish
Basically, your program has to actually work for any input, given enough time. You don't have to wait around for years to see what n=30 gives you, but it has to still theoretically work if you did

4:55 PM
@DJMcMayhem But do I have to pre-allocate enough memory (depending on language)? or enough temp table space for literally any n? Again, I think I understand the intent, I just think the vagueness of the specification makes this not a great question

That's a problem that does come up from time to time. Generally it's allowed for submissions to fail because of memory restrictions. But "There's not enough memory to give a result for some N" isn't an excuse to hardcode up to N and call it good
Although to be fair, this particular challenge doesn't explicitly say that you have to handle n > 10 off of TIO, so idk

Is hard-coding output one of the generally-excluded no-no rules? Can't recall

140

Hard-coding the output Unless the question is an obvious exception (the primary exception being those tagged kolmogorov-complexity), your program is expected to do work, not just print a pre-calculated result. If the question doesn't require input and so a solution which just prints the answer w...

yep, Arnauld just posted that to the original question
gotcha

That's the reason I found it so quick haha

1 hour later…
6:01 PM
0

Consider a 15x15 Matrix. The matrix has been filled up with integers (duplicates inclusive). Now consider all sets of 4 integers which can be formed such that every number in the set is either vertically or horizontally or diagonally adjacent to at least one other number in the same set. Find the...

6:22 PM
0

Shuffling Sequence code-golf number sequence Consider an operation \$f_n\$ that takes a length-\$2n\$ list and performs a perfect shuffle on it, reversing the second half. For example, \$f_4 [abcdABCD] = [aDbCcBdA]\$. Under composition, \$f_n\$ generates a cyclic group. That is, there exists s...

6:54 PM
@Arjun This is just causing work for no good reason.

1

According to Wikipedia, Clock Solitaire "is a game of zero skill and is a purely mechanical process." That makes it the ideal task for a computer. The rules are simple: Shuffle 52 cards into 13 piles of 4 face-down cards. Arrange 12 of the piles in a circle (corresponding to the 12 hours on a ...

7:26 PM
0

I found question where author ask about reproduce logo (reproduction do not need to be identical). In one of answer we see solution with low resolution logo picture made by hand This solution indeed is very small 202 bytes - but the question is: does this approach (create low resolution pictur...

2 hours later…
9:19 PM
@wizzwizz4 so is :P

9:32 PM
CMC: This question is impossible in brain-flak without using comments. If instead of just reversing, we also swap opening/closing brackets, (so ({}()) becomes ((){})) it becomes possible.
Soo, do that I guess?
Same thing works for this one
I've got 12 for the first one

10:14 PM
@DJMcMayhem In my case, better yet: somebody writes a random rip-off of a challenge of mine that happened to receive a lot of attention
Happened again today.

1 hour later…
11:44 PM
0

Maximize the Hello, world's in code permutations In this task you should output this exact string: hello world. However, here is the catch: you must output as many hello world's as possible in all of your code permutations. Identical permutations do not count(e.g. aa's permutations count as one ...