« first day (2185 days earlier)      last day (2779 days later) » 

12:00 PM
EE342, Problem Set 5
Try 4.14 on
 
actually my uni is pretty nice atm
 
user1804599
The cinch is unbearable
 
a lot of coding, a lot of freedom
//macro
#define details(name) (uint8_t*)&name,sizeof(name)
sigh
 
@BartekBanachewicz Is that supposed to be a byte?
 
fuck knows
 
12:01 PM
heh heh
 
not my code
 
Ah, did you catch my blog post Bartek?
 
@VermillionAzure ok
 
@VermillionAzure no?
 
@BartekBanachewicz vermillionazure.com
@orlp Just tell me what you think
 
12:02 PM
not that difficult
it's permutations
 
@orlp Tell me your solving process
 
ok, so there's 5! = 120 permutations the numbers can go
if we assume that player 1 wins or loses all, their number is at the end of the sorted numbers
which means that the other numbers can permute at will
 
user1804599
@BartekBanachewicz nice
 
@orlp P(X=0)?
 
so P[x = 0] is 4!/5! and so is P[x = 4]
 
12:04 PM
@VermillionAzure it's meh
 
@BartekBanachewicz It really is, I agree
But it's a start
 
how about you write about things you feel good in
 
@BartekBanachewicz Like what
C++ Tutorials???
 
dunno, not computers or programming?
 
@orlp That's not right though.
P(X=0) is 1/2
 
12:06 PM
I wasn't done yet :(
 
@VermillionAzure a start of what?
 
just giving my initial thoughts
 
@BartekBanachewicz I'm going to try and work on it when I can and try to use it as motivation for doing things
Also it gives public presence for recruiters
 
I should've said >=
 
whatever motivates you I guess
@VermillionAzure eh, depends on what you want to present
I think I want another coffee
 
12:07 PM
@BartekBanachewicz I'm planning on using it as basically an online journal of notes and stuff and some nice articles if I like
e.g. I might do one when I redo my Pong application
I should be better as designing things and such
 
a journal and "stuff" p much contradict each other
 
@VermillionAzure I do know that P(X=4) is 4!/5!
 
@VermillionAzure how about you focus on getting better instead of writing about it
 
that only happens if player 1 has the biggest element
 
@orlp That's correct.
@BartekBanachewicz Oh you set yourself up GOOOOD
 
12:09 PM
@VermillionAzure because you have only that much time and dividing it means not getting maximum progress in either
 
@BartekBanachewicz I'm not gonna get maximum progress because I'm lazy anyways
 
if player 1 wins 3 times then that leaves no choice: he must have a number that's the second biggest in the array
 
@orlp Warmer
 
err
 
@VermillionAzure still applies
 
12:11 PM
@BartekBanachewicz i know lol
man I wish there was a more subtle way for sarcasm besides /s
2
 
ueh C abstractions are like no abstractions at all
fucking global state
 
@BartekBanachewicz What happens when Valve uses global state everywhere in their program?
The hackers start a GLOBAL OFFENSIVE
 
mixed naming conventions
gosh
 
And the Illuminati gets angry that Valve did it first
 
@VermillionAzure wait, 4!/5! is 1/5
and that's also P[X=3]
because there's a flat 1/5 chance we get assigned the biggest number, or the second biggest number
 
12:15 PM
@orlp It's not
 
@VermillionAzure is my assumption incorrect?
that X=3 can happen when we do not have the second biggest number?
 
@orlp I believe so
 
how?
 
You can have the 3rd biggest number and still have it work out
 
we won against 3 people
 
12:17 PM
Or...
 
so we know that our number is bigger than at least 3
 
Hmmm... Nah, you need to have 4 I think
 
we know for sure
there are three numbers that are smaller than us
then comes our number
 
Actually... Yes. You do need to have 4.
 
and we can not be bigger than the last number
 
12:18 PM
Sorry, my bad; you're correct.
 
so P[X=3] is 1/5 as well
P[X=2] is a bit more interesting
 
@orlp It's not 1/5 though
 
@VermillionAzure if numbers are uniformly distributed, the chance of getting a permutation where we have the 2nd biggest number is exactly 1/5
 
@orlp That's true. But that's not what X=3 is.
 
we just established that X=3 only occurs when we have the 2nd biggest number
if and only if
 
12:20 PM
@orlp You're missing another part. You're close, though.
Hint: P(X=3) is the intersect of 2 events.
 
I don't believe it is
 
@orlp Should I tell you?
 
sec
ah wait
we can have the second biggest number
but meet the biggest early
so we need to subtract the chance of that happening
 
@orlp Warmer
But there's another way to look at it that's easier
 
the chance that we have the second biggest number is 1/5
@VermillionAzure I can extrapolate patterns later
 
user1804599
12:23 PM
Hmm, this is interesting solution. :) glot.io/snippets/ej7c85gdjc
 
the chance that the biggest number is after that is 1/4
(4 places it can go, only one is bigger)
the chance that it is NOT after that is 3/4
thus 1/5 * 3/4 is P[X=3]
 
@orlp You also need to consider that just because it's not directly after doesn't mean it's at the end.
 
@VermillionAzure it is
there's only 5 numbers
we have the second biggest
if it's after us, it's at the end
 
@orlp If we write it as [4, 5, x, x, x]
That's 1/5 * 1/4
If we go 1/5 * 3/4
That means that [4, x, Y, Y, Y] where 5 is one of the Y's
and not x
 
@VermillionAzure I don't use that mental model
 
12:26 PM
If P(X=5), we know that 4 must be at the start and 5 must be at the end
 
[x, x, x, 1, x]
that's the one I use
where 1 is player 1
 
@orlp You should fix the positions and focus on the sequence of values
 
I guess that's where I went wrong
or well
made it hard for myself
 
The set is well-ordered and every sub-sequence is well-ordered
 
using your model
P[X=4] is [5, x,x,x,x]
 
12:28 PM
Yes.
 
P[X=3] is [4,x,x,x,5] because we may not meet 5
 
if we fix 4 in the first position (1/5)
there's 24 ways the other elements can go
in 6 of those 5 is at the end
1/5 * 6/24 (or 3!/4!)
 
Those two fractions are not equivalent
 
I meant
6/24 == 3!/4!
 
12:31 PM
So 1/5 * 1/4 is 1/20.
And that's correct.
P(X=3) is 1/20
 
with P[X=2] we need to beat two numbers, and then lose
 
Tip: Decouple the logic from the specific numbers 4 and 5
 
so our options are 3 or 4 for the first number (with 5 we couldn't lose)
hold your horses
with 3 we have [3,x,x,4,5], [3,x,x,5,4]
with 4 we have [4,x,x,5,x]
if we look at [x,x,4,5] and [x,x,5,4] we can swap the two xs and the 5/4
so 2 * 2 ways it can go, out of a total 4! permutations
with 4 there's 4! permutations after fixing 4, and 1/4 of those have x,x,5,x, so 4!/4 as well
1/5 * (4/4!) + 1/5 * (4/4!)
which is lower than 1/5
which makes me doubt myself
 
@orlp The answer is indeed lower than 1/5 NOT SORRY THIS WAS WRONG
 
@VermillionAzure I would never think that P[X=2] is lower than P[X=4]
intuitively
 
12:39 PM
@orlp Oh wait, nvm
My brain said the denominator is lower, lol
 
oh wait
with 4 it's just 1/4 that have 5 in the right spot
1/5*(4/4!) + 1/5 * (1/4)
but that's still lower than 1/5..
 
user1804599
Haskell is awesome.
 
@rightfold @BartekBanachewicz ^ fite
 
@orlp That's correct.
The answer, that is.
 
user1804599
@BartekBanachewicz @Ven what do you think of this EDSL for generating SQL expressions and Haskell functions? glot.io/snippets/ej7c85gdjc
 
12:43 PM
1/12 = P(X=2)
 
5 mins ago, by VermillionAzure
@orlp The answer is indeed lower than 1/5 NOT SORRY THIS WAS WRONG
which is it?
 
@rightfold looks fun
 
user1804599
So Expr takes an environment type and a result type. Then toHaskell ensures environments are passed correctly. For example, within a Sum, the environment is a single invoice line, but outside a Sum, it's the collection of all the invoice lines
 
@VermillionAzure mind if I cheat?
or well
be 'smaht'
 
12:45 PM
@orlp What do you mean?
@orlp It's 2:45AM im sorry
 
so far we found X=4 = 1/5, X=3 = 1/20, X=2 = 1/12
X=0 is trivially show to be 1/2
 
ugh arduino doesn't have std::variant right
 
that must mean X=1 is 1 - 1/2 - 1/5 - 1/20 - 1/12
so X=1 = 1/6
[1/2, 1/6, 1/12, 1/20, 1/5] is the solution
 
how can I quickly replace Variant
for PoDs
 
@VermillionAzure :)
 
12:48 PM
@orlp That's right.
So do you want the explanation now?
 
no I understand it
 
an union!
 
1
Q: Combinatorics/Probability - Why does this equation work?

VermillionAzure Five distinct numbers are randomly distributed to players numbered $1$ through $5$. Whenever two players compare their numbers, the one with the higher one is declared the winner. Initially, players $1$ and $2$ compare their numbers; the winner then compares her number with that of player $3$, a...

The first answer.
 
user1804599
I read about someone using ATS on Arduino.
 
user1804599
It has ADTs :p
 
12:50 PM
I can make an union of two pod structs right
 
user1804599
sure
 
user1804599
tag it with an enum
 
yeah
    struct ReadResult {
        bool status;

        enum class TypeOfPacket {
            HandshakePacket,
            VehicleData
        } typeOfPacket;

        union {
            HandshakePacket handshakePacket;
            VehicleData vehicleData;
        };
    };
 
@orlp The formula he gives is a lot simpler. And the logic behind it is simpler as well
 
@VermillionAzure yes
@VermillionAzure I came from 'the other end' so to speak
was baited by how easy X=4 is
 
12:52 PM
@orlp Really, the only thing your logic could've used is that you can just limit it to the subsequence
[4, x, 5] x x is basically choose 2, then choose the greatest of 3, and choose the greatest of 2
 
often in mathematics getting off on the wrong path means you'll just get stuck :P
 
@orlp Combinatorics sucks
 
@VermillionAzure I disagree :P
 
It's literally riddles and tricks
For all the math classes I've taken, I've never taken one dedicated to optimizing proof search space and problem solving
 
@VermillionAzure you know what sucks?
computer science
you wake up
you think of some problem
 
12:54 PM
@orlp You know what really sucks?
 
find out problem is NP complete
go to bed
rinse and repeat
everything that isn't NP complete was figured out in the 70s
 
@orlp What REALLY sucks is Quaternion Fourier Transform.
@orlp So now the question is how to turn NP Complete problems into P problems using axioms
 
honestly it's pretty cruel
the whole academia of CS has decided
that asymptotic complexity is the only thing that matters
then grabbed all the low hanging fruit
 
@orlp I disagree
There's still a lot to be done in security and stuff. Kalman filters are more recent and such
Intuitively understanding the significance of machine learning and why it works so well is another problem
Extracting insights from neural networks through some sort of human-computer interpretation layer is also another huge stride that we could bridge
 
    switch(result.typeOfPacket) {
    case ReadResult::TypeOfPacket::HandShakePacket:
        Handshake(result.handshakePacket);
        break;
    case ReadResult::TypeOfPacket::VehicleData:
        Indicators(result.VehicleData);
        break;
    }
eh, better than before at least
 
12:57 PM
@VermillionAzure I don't believe it to be possible
for something to be comprehensible for humans it has to be elegant
 
@orlp Half of that work will come from the empirical psychology side
 
there is no elegant solution for those kind of problems
 
Yello
 
'does this image contain a cat'
does not have a solution
 
@orlp Depends on what a cat is
 
12:58 PM
other than a massive matrix
with magic values
 
@orlp I respectfully diagree
 
@orlp Why are you arguing with Cinch?
Remember, if you are arguing you are losing
 
@Shoe ?
 
@Shoe Corollary: if you're arguing with Cinch you've already lost.
 
user1804599
cinch thread
 
user1804599
1:00 PM
you cinch you lose
 
:star:
 
But my initial argument still stands
Computer science is not a dead end, by far.
As a future graduate student applicant, there is much to do and so much we can do
 
@VermillionAzure I mean that the 'establishment' has stifled progress by focusing on asymptotic complexity and then grabbing all the low hanging fruit
 
I just had a dejavu
 
@orlp Well, if you mean "the establishment," I dunno about that...
 
@Shoe Was it a cat walking in a stairwell?
 
@VermillionAzure some areas are still sane
 
@orlp There's a lot of groups that focus on a lot more than just algorithmic complexity
 
for example computer graphics
has a ton of interesting stuff going on
 
Compilers, concurrency, systems, etc.
 
1:02 PM
@wilx Nah, it was orlp talking about asymptotic complexity and low hanging fruits
 
with interesting techniques
 
The matrix is still alright
 
but for algorithms/data structures
shit's fucking dead in academia
I mean, sorting is a 'solved problem'
 
> As a future graduate student applicant
kek
 
then why is pdqsort twice as fast as std::sort?
 
1:02 PM
@orlp Watch when quantum comes in
 
6 mins ago, by orlp
then grabbed all the low hanging fruit
Oh man
 
@VermillionAzure quantum is a whole nother story
 
The repeat cycle is just 5 minutes long
 
@orlp Think about biocomputing
 
We are going to hear about low hanging fruits every 5 minutes now
 
1:03 PM
so this other day I was grabbing some fruit
and I noticed some hanged low
 
lol
 
okay
refactoring mostly done
 
@VermillionAzure you have to understand, I'm talking about 'classical' algorithms and data structures
 
I should be able to put this into my program cleanly soon
 
those are all about asymptotics
 
1:04 PM
So now bartek is the new rightfold I see
 
@Shoe I'm doing cool stuff
 
@orlp When you say, "algorithms and data structures," we're going to be in a very different place when people talk about that very soon.
 
I wonder why no one is using skip lists while academia is having a circlejerk over em
 
Talking about his progresses to a bunch of people who don't really care all too much about it, as it appears :P
 
oh right cuz they fucking suck
 
1:05 PM
@orlp Apparently they may be suited for concurrency... which would be a boon
 
@VermillionAzure repeat after me: shared data is a fad and will go away
 
@orlp ???? they are being used
 
@orlp Can you clarify that?
 
@VermillionAzure for a long time people thought that fast concurrency was just a matter of inventing 'lock free' or 'wait free' data structures
 
Ven
@rightfold I'll look at the DSL Later
 
user1804599
1:07 PM
yay :)
 
but you're pretty much always better off just not sharing data between threads
 
@orlp That doesn't mean that shared data itself is a fad.
Also, shared data is necessary for any large scale system, right?
 
user1804599
Map–Reduce
 
@VermillionAzure nah
 
@orlp Databases seem pretty important...
 
1:09 PM
although we're getting out of scope here
I'm talking about low-level concurrency
not 'cloud' level concurrency
 
@orlp Concurrency in its many forms should remain important as Moore's Law stagnates
 
threads, mutexes, semaphores, locks, barriers, etc
in those
shared data is a fad
I assumed that was obvious
 
Well, it's still important.
You can't just ignore these topics either.
But I think the word I should rather use is parallelism
that is going to remain important
 
other way around
I should say parallelism
concurrency is the more abstract term that can be applied to large-scale systems
 
user1804599
Parallelism is a term that can also be applied to distributed systems.
 
1:13 PM
They're so very close in definition
 
user1804599
Parellelism in a single address space.
 
@orlp Regardless, shared information is necessary for any parallel computation
 
@VermillionAzure it's not
 
@orlp Communication between threads is necessary for multi-threaded applications
3
 
duplication, messages, channels, etc
@VermillionAzure there's many ways of communication that do not involve shared data
 
1:14 PM
@orlp Note how I said information, not memory
Memory is a shared space. Information is a shared value.
 
@VermillionAzure Note how you said 'Regardless' as if my point didn't apply while I was talking about memory the whole time
you pretend you disagree
but then make an orthogonal remark
??
 
@orlp Regardless, as in, "I'm going to off on a tangent regardless of the past," yes.
 
@orlp it's Cinch, you need to understand
 
@VermillionAzure that's not what regardless means
 
> without paying attention to the present situation; despite the prevailing circumstances.
 
1:16 PM
regardless isn't 'meta'
 
@orlp Regardless doesn't necessarily imply that you're attempting to negate a person's argument when you're using it against it.
It's changing the topic or angle of the topic
 
1:30 PM
@ScarletAmaranth he was warned several times
 
1:46 PM
great success
i've coupled the refactored arduino code for ksp data with my led panel
works perfectly
this is exciting
 
@orlp Eh, that's generally the kind of trick that's used when using std::advance on forward or bidirectional iterators :p
 
@Morwenn yes :P
but in this case it helps because it makes the branch more predictable
 
That's rather smart.
 
and it doesn't cost anything for the vector case
it's just one integer subtract / move per swap
 
The algorithm is far from its original simple ~300 locs now.
 
1:57 PM
@Morwenn :)
 
@BartekBanachewicz cool.
Is that an XBee I see?
 
@BartekBanachewicz Bartosz?
 
@orlp that's my official name
Bartek is a diminutive
@VermillionAzure a what
 
@BartekBanachewicz so you're Bartosz when with a beautiful woman in bed, and Bartek on a cold alone morning?
2
 
2:08 PM
@PatrickM'Bongo Repost! You even got more stars than me :(
 
@BartekBanachewicz Oh wait that's an Uno
 
@Borgleader Of course. It's me.
 
@orlp I very rarely use the official form
 
@BartekBanachewicz And Haskellewicz?
you should change your name to that
 
user1804599
2:43 PM
Bartek Curry
 

« first day (2185 days earlier)      last day (2779 days later) »