« first day (1592 days earlier)      last day (3434 days later) » 

11:00 PM
I should change my name again...
 
@Chris'ssis Thanks. What movie are you watching?
 
@evinda It does.
 
what was it before, @TomCruise?
 
Com Truise
 
@DanielFischer At the beginning, we get the following, right?
 
11:00 PM
LOL, don't remember that one.
 
What does it mean @DanielFischer?
 
@JasperLoy La Vita e Bella (1997)
 
$|x-1|$
 
@evinda The counts of $0$ and $1$ are swapped. With that corrected, it means the array contains no element $\equiv 0 \pmod{4}$, one element $\equiv 1 \pmod{4}$, one $\equiv 2 \pmod{4}$ and two elements $\equiv 3 \pmod{4}$. The condition $\equiv k \pmod{4}$ is another way to express that the last (lowest order) digit of the number in base $4$ is $k$.
 
@Chris'ssis I watched that a few times, lol, principessa!
 
11:05 PM
@evinda It's probably a good idea to write the numbers in base $4$, using two digits for each (that means, a leading zero for numbers $< 4$). We have $15 = 33_4,\, 7 = 13_4,\, 14 = 32_4,\, 1 = 01_4$.
 
subtitles $\implies$ reading $\implies$ no fun
just kidding I like some foreign films
 
@JasperLoy :-)))
 
@DanielFischer And how does this helps, when we write the numbers in base 4?
 
@evinda It makes it easier to see how the algorithm works.
 
@DanielFischer After that, we find this:
@DanielFischer What does it mean? :/
 
11:19 PM
@evinda Actually, first count looks 0,1,1,2, and after the loop count[m] = count[m] + count[m-1] we get count as 0,1,2,4, not 0,1,2,3. At that point, count[m] contains the number of array elements whose last digit is $\leqslant m$.
And that is - I assume $0$-based arrays - one more than the last index where a number with last digit $m$ shall be put in the B array.
 
Can someone tell me if we have to prove in that way?? math.stackexchange.com/questions/1047420/…
 
@DanielFischer To check if the last digit of the numbers is $\leqslant m$ do we look at their respresentation in 4-base, or not?
 
@evinda Yes, base $4$.
 
@DanielFischer A ok.. But how can we relate the first array to the second one we got? :/
 
@evinda The two states of count? The second is the cumulative sum of the first.
 
11:36 PM
@DanielFischer So is it random that the first array contains at the $m$th position the number of numbers that are equivalent to $m \pmod 4$ and the second contains at the $m$th position the number of numbers of which the last digit is $\leq m$ ? :/
 
@TedShifrin I will dare to say the final isn't that challenging. =D
 
@evinda Absolutely not. It's what makes the algorithm work. When we fill that intermediate array B, we must know where to put each element of the original array when we encounter it. For that, we must know how many elements will eventually be placed before it.
 
When someone only says $R^n$ what things am I allowed to consider?
I was reviewing linear algebra stuff, my brain hanged!
It should refer to $n \times 1$ matrix, right?
 
@DanielFischer Could you explain me further why we are looking at the number of numbers of which the last digit is $\leq m$ ?
 
@evinda You know that the purpose is to first sort the numbers according to their last digit, ignoring the first, right?
 
11:46 PM
@DanielFischer Yes...
 
@FreeMind I don't understand your question.
 
@PedroTamaroff Nevermind, I was not okay :D
 
@evinda To determine where each array element will be placed, we count how many elements have last digit $k$ - for all possible values of $k$ - and then add them up to know at which position the last number in the array with last digit $k$ shall be placed.
 
@DanielFischer Fascinated by your answers in Stack Overflow.
 
@FreeMind Some are better than others.
 
11:50 PM
@DanielFischer Are you a programmer? Do you pursue it as a profession?
 
@FreeMind No, just a hobby. But since I'm active here, I have hardly done anything in that area. Mathematics is somehow more fun.
 
Hear hear
 
@Pedro: let's see all the solutions. Remember that I give far harder homework and allegedly straightforward exams.
Hi @Studentmath
 
@Ted Did you have the test already or is it coming wednesday?
 
This coming Wed
You too can tell me it's routine, but it'll be hard for many of my students.
 

« first day (1592 days earlier)      last day (3434 days later) »