30 November 2019

Codeforces Round #603 (Div. 2) Postmortem

Link to contest.

What went well
  • I got ABCD.
  • Expanding on getting ABCD, I got C and D fairly quickly, at T+36min and T+48min respectively. (Then again, D was not particularly hard, as evidenced by its 1500 rating).
What went wrong
  • I didn't get A until T+1h30 and two wrong tries.
  • I did not upload anything for E because my fastest solution sketches were O(NlogN), which I thought were too slow for N = 1,000,000. Turns out that O(NlogN) and a good constant factor is fine for such large N.
  • I also misread E: I thought that the cursor can be moved to the left of the starting position, but the problem clearly says that it can't.
Where I got lucky
  • Implementing C and D went very smoothly, taking 12min from end (open problem statement) to end (pretests passed).
  • E felt approachable.

28 November 2019

Educational Codeforces Round 77 (Div. 2) Postmortem

Link to contest.

What went well
  • I didn't give up.
  • I quickly figured out the approach for D, which was binary searching for the answer.
What went wrong
  • I got A four (!!!) minutes before the contest ended (at T + 01h56).
  • I didn't get D.
  • I incurred a lot of penalty from wrong-answering B (twice) and C (once).
  • I had no milk for my pre-contest coffee.
  • I felt pretty awful waking up at 0530 to do the contest.
Where I got lucky
  •  The contest was hard for everyone else, so I only lost less than 50 elo for my poor performance.

23 November 2019

A Taste of Quantitative Trading

Think you're interested in quantitative trading? Try your hand at this problem, courtesy of E6 Trading:
Two card players have hand strengths distributed independently & uniformly over [0, 1] and are playing for an existing pot of $100. Player 1 can check or bet $100. If Player 1 checks, the player with the stronger hand wins the pot. If Player 1 bets, Player 2 can call the bet or fold. Given both players are risk-neutral paperclip expectation maximizers, how does each play?

20 November 2019

Codeforces Round #597 (Div. 2) Postmortem

Link to contest.

What went well
  • I solved C and D relatively quickly. 
  • I was pretty close on E1.
What went wrong
  • I didn't get B.
  • B had more than 2 errata.
  • I didn't read E2 before I started to think about E1. This time, E2 was simply the same problem, but with higher limits.
Where I got lucky
  • Fewer people than usual solved D, so I managed to get rank #401 (top 4%) with just ACD. Normally ranking that high needs a reasonably fast ABCD.

02 February 2019

Pattern Matching Wildcard Commentary

While reading Google's Haskell training, I encountered some code for the function (&&), which I thought was mildly unintuitive:

(&&) :: Bool -> Bool -> Bool
True && y = y
_ && _ = False

The reason I found this definition odd is that the author chose to use a wildcard (the first underscore in the second line) instead of the explicit data False. Since Bool only has two choices, True and False, I think explicitly using False instead is more intuitive, since I had to think about the other values that the wildcard can take on besides False. Furthermore, the Haskell compiler, ghc, will validate whether all patterns are matched in the function definition.

Thus, I would rewrite the function as:

True && y = y
False && _ = False

*

Additional commentary:

Brian Hamrick likes when the wildcard is conceptually a catch-all, i.e.:

True && True = True
_ && _ = False

At first, I thought this best describes the logical truth table, where the only True result is from the inputs (True, True). However, this changes the laziness properties of the function in Haskell: the second argument is forced to evaluate when the first one is True since we do not have enough information to match (AN: this was not obvious to me at first). If the second argument is True, then we match the first line; otherwise, we match the second line, so the second argument gets reduced to weak head normal form (WHNF).

*

Thanks to Brian Hamrick for help with this expository post.

01 January 2019

18 October 2018

Life is short

My YOLO of the year becomes a little more validated with every passing.

"One ought to enjoy life, really." from things traders say

RIP

02 October 2018

An Observation of People's Behaviours

Found in a thread on a car forum. From an acquaintance, who manages a team of 5,000 at a premier technology company:
If I may make an observation -- as someone who manages a team of ~5,000 people in my day job, and thus has the opportunity to see a few patterns of behavior -- you are indicating that you are upset by how some people who aren't you behave towards other people who also aren't you. To be happy in those circumstances will require that everyone behaves the way you wish they would behave, all the time, any time you have or will have the opportunity to observe their behavior. If you can figure out why that's the case -- why it's so important to your happiness that other people behave the way you want them to -- well, the folks I've seen who figure that out are really glad they did afterward.

22 September 2018

tl;dr of What does it take to become a Ferrari VIP?

tl;dr Spend money while building a mutually beneficial relationship.

Here is the acronym presented in the video which describes the four ways of building that relationship:

L - loyalty: within a brand, stick with a dealer.
O - options: almost pure profit for dealers and factory.
V - volume: buy lots of cars; if the dealer needs to move a particular model, do not say no!
E - events: attend events, such as hospitality, racing schools, etc.

17 February 2018

On Mediocrity

Context: What is going on with Counter Logic Gaming in the NA LCS 2018?
The same what is going on with CLG in every esport: mediocrity. 
CLG lost their Dota 2 and CS:GO teams already, somewhat promising, left them in mediocrity till they disbanded. 
This organization doesn't have neither money nor structure to support successful teams.
It really feels like the management is just trying to stay afloat as a brand while spending as little as they can on everything. 
Hell, we lost our team leader/shotcaller cause we couldn't match other teams offers.
When you're okay losing your only star player, a huge brand promoter also, you know you're looking at a zombie organization. 
And to think /r/clg was so delusional when this roster was announced. Sure, what better than 2 players that barely give a damn about winning, barely train in soloq (Stixxay and RO), two very inconsistent solo laners and a timid, barely vocal support together? I'm sad for Biofrost, he's a decent player, our only consistent performer, but he's just the worst fit in this team. We needed Aphro so much. How can you put shotcalling duties on Huhi, a guy that barely understands matchups (legendary losing 1v1 Vlad vs Cassio, as Cassio first and as Vlad after in the same Bo3 versus Liquid last game), half of his roams are a waste of time and used to have the lowest kill partecipation in the league? 
What did management think? That stars were going to align as they did in spring 2016? 
That Piglet was going to throw a game 5 times in a single game again? That Stixxay was forever going to make miracles and not die to Elise cocoons due to how Trist's W works? That lane swaps would've allowed to mask our weankess all time? 
Our run in spring 2016 should've been a warning on how poorly the team was built, but it got masked by the luck we had and the clutch plays of some of our players, but that ended, and now we're 4 splits in a row deep in mediocrity. 
We're 0-8 vs TSM, 1-9 vs IMT/Liquid 2018 and like 2-7 vs C9? 
We're consistently garbage, yet nothing changes. 
I bey my ass the Dardoch problem was Dardoch getting on the team, as competitive as he was pushed everybody to work hard (and look at clg in summer 2017 they started so convincingly)..But no..You can't bother Stixxay with hard work, better remove the jungler. And knowing Dardoch it had to be painful to work with him, when the rest of the team is just "chill, we fine with mediocrity and faith". 
Just smiles, faith memes, patting our team on their shoulders, because after all, it's not even their fault, shit's trickling down from above.
https://www.reddit.com/r/leagueoflegends/comments/7ya4fc/counter_logic_gaming_vs_team_liquid_na_lcs_2018/duextam/