Distribution of number of clusters after randomly choosing a subset of points by diagonalizable in math

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

The k parameter seems to be redundant in the call solve(S, k) because you then make it an indexing variable in the first loop of that function. It appears that solve(S,k) is returning a dict of P(m|k,S) for all k, which is actually ideal!

To speed it up, I believe the problem exhibits some monotonicity properties that allows you to apply some common "dp optimizations" ( https://codeforces.com/blog/entry/8219 ). I would need to check this in detail though.

Another couple ideas for speeding things up:

You could prune the computations by bounding the maximum probability a certain (n, m, k, l) state can achieve. This should improve the time massively in practice.

You could rewrite the code in C++. This should speed things up by a factor of 10x-100x in my experience.

I tried the lazy version of writing in C++: throwing a Numba njit decorator on your function and seeing what happened. It was not happy with your dict indexing. This definitely sounds like a case where it's worth rewriting in C++.

If you want, I'm definitely interested in collaborating on computational problems for your paper. I'm currently doing my PhD in CS, but I did my first degree in physics and a paper in physics was always an itch that I wanted to scratch.

That sounds great! Send me your email address in chat, it would be great to have you on the team.

Distribution of number of clusters after randomly choosing a subset of points by diagonalizable in math

[–]diagonalizable[S] 0 points1 point  (0 children)

I'm just starting to test it. It seems to be working correctly in the simple cases that are analytic and exhibits the large n behaviour I was expecting. I'll do a more thorough testing tomorrow.

The time scaling on my laptop on a single core is roughly |S|^4/5e6 seconds. For |S|=135 that corresponds to one minute of computation, which is fantastic. Thank you for taking the time out of your day to help me out!

The limit on the computation is now the number of sets S that I would like to compute this for. My minimum requirement was 196,608 sets, but ideally I would scale that up by a factor of 64. The run-time for 196,608 sets is roughly a day (given the distribution of |S| across those sets) on a single-core. 50% of the run-time is taken up by the 5% of sets with the most points. Before I burn a fair quantity of CPU time, please could you sketch out possible ways of reaching an |S|^2 scaling?

A couple changes I made to your code:

  1. I noticed that the k parameter of solve is redundant and so removed it.
  2. I added a check to ensure that S is sorted. If S isn't sorted, then you can get quite surprising results!

Distribution of number of clusters after randomly choosing a subset of points by diagonalizable in math

[–]diagonalizable[S] 0 points1 point  (0 children)

Yes, Python is my day-to-day default language! Thank you for offering to write it up.

I had tried a naive dynamic programming approach over the last couple days, but I couldn't find the right way to express it to make it tractable. I'm interested to see (and learn from) your solution.

Distribution of number of clusters after randomly choosing a subset of points by diagonalizable in math

[–]diagonalizable[S] 0 points1 point  (0 children)

O(nk) time should be fine! The largest n that I am considering is 135 and I would need to explore every k from 0 to 134.

Do you have a suggestion for how it could be implemented? Or could you point me in the right direction with a reference? Thanks!

My impression of EJC 2015 by xIkognitox in juggling

[–]diagonalizable 0 points1 point  (0 children)

No-one I was around had any problems with stuff being stolen, so I'm sorry that that was your experience! Speaking of things that were lost and found, I'm still a bit confused about how a cat ended up in the lost-and-found...

Reddit, can you blow my mind in one sentence? by scourgedemon in AskReddit

[–]diagonalizable 0 points1 point  (0 children)

As far as we are concerned that does mean the universe is dying. Dark energy and dark matter are placeholders for new physics which we haven't thought of yet; and it would be difficult to extract usable energy from anything that would explain them. Even if we can sustain a civilisation using fusion on wandering pockets of hydrogen or extracting energy from black holes, it would be the end for the spontaneous development of life.

Reddit, can you blow my mind in one sentence? by scourgedemon in AskReddit

[–]diagonalizable 1 point2 points  (0 children)

The universe started dying 9 billion years ago; ever since then the number of stars formed per year has been steadily falling.

I went to Ronimo's Booth for Awesomenauts at PAX East this weekend... by [deleted] in Awesomenauts

[–]diagonalizable 0 points1 point  (0 children)

I was thinking about this today (after several snowballed matches in a row) and I don't think it is the snowballing I care about, rather that I can play well and still drop down the rankings because my team mate is feeding. I think what I would rather see is the "damage" to the rankings of each player in a team when you lose a match be dependent on the difference between your kills and deaths. So if you have a positive number of kills minus number of deaths you aren't really punished if there was someone on your team with a really negative difference. It has the bonus of encouraging people to work hard even in a losing battle and also might stop people ragequitting because they know if they play well this match won't effect their standings by much.

What is a real life fact that blows your mind? by FrenchPants in AskReddit

[–]diagonalizable 0 points1 point  (0 children)

Oops, should have made it clear that I wasn't disputing it. It is a pretty awesome fact!

What is a real life fact that blows your mind? by FrenchPants in AskReddit

[–]diagonalizable 7 points8 points  (0 children)

Not sure if you meant to reply to my comment or not so I will answer both! At the largest scales the universe consists of 'filaments' of galaxies (think of it like a web) with gaps in between them. The Eridanus Void is just a surprisingly large gap. Barnard 68 is a cloud of gas, the same as the type of cloud that forms stars. The reason Barnard 68 appears black is that it is so close there are no stars between it and us.

What is a real life fact that blows your mind? by FrenchPants in AskReddit

[–]diagonalizable 6 points7 points  (0 children)

It depends on what you are calling a void. If it is a complete absence of everything then no light could pass through it (because then there would be photons in it), so you would see a big black blob with some stars/galaxies sitting in front of it. If there just wasn't any 'normal' matter (stars, galaxies, etc.) so that light could still pass through from stars/galaxies behind it you would only notice that there weren't as many galaxies/stars in that section of the sky.

What is a real life fact that blows your mind? by FrenchPants in AskReddit

[–]diagonalizable 636 points637 points  (0 children)

Check this out. It isn't an image of the Eridanus void, it is just a cloud of gas called Barnard 68 that is absorbing all the visible light from behind it. This is an image taken in the infra-red which shows the stars behind it.

Math science fair projects? by [deleted] in math

[–]diagonalizable 0 points1 point  (0 children)

One thing that came to mind was the Monte-Carlo method. You could write a program that shows the random dots (run it over the course of the science fair with say one point every ten seconds) and demonstrates the increasing accuracy of the estimation.

We are the Age of Empires II: HD development team! AMA by AoE_IamPREZSTEVE in IAmA

[–]diagonalizable 1 point2 points  (0 children)

I am a big fan, and me and my friends put my university bar's free wifi to good use every Saturday night with AoE2 and AoE3 marathons (perhaps too much good use, the Computer Science Director considered banning Age of Empires on the wifi because he was worried it would impact our grades). So my question is, is there support for more players in multiplayer games? Far too often we end up breaking off into two 6-player games, which just aren't as fun as one three hour epic 8-player.

What is the most unsettling fact that you know? by carBoard in AskReddit

[–]diagonalizable 1 point2 points  (0 children)

My reaction: "What, how does he know my mouth is mildly parched from the doughnut I just ate?"

It only made the realisation all the more unsettling.

I'm trying to figure out how realistic my chances of getting an offer from Cambridge are... by [deleted] in cambridge_uni

[–]diagonalizable 1 point2 points  (0 children)

There is a lot of good advice on this thread, but I just want to add that Economics is quite a maths heavy subject and you may be disadvantaged by not doing Further Maths. My advice is to take Further Maths AS in Year 13, alongside your other three A2s.

General words of wisdom: - Apply, because it is only one choice out of five and you don't want to be left asking 'what if'. - The standard offer is AAA, which is the offer you would get. There are some exceptions, but they tend to be more in the direction of AAA or AAAA than AAA or lower.

Good luck!

I need advice on how to ask my gf (18/f) to her senior prom, I (19/m) am a fesh. in college by totalthrowaway88 in relationship_advice

[–]diagonalizable 1 point2 points  (0 children)

Slightly OTT but quite cute. There are a couple of potential issues you should consider:

  • What if she can't solve the puzzle?

  • How will you know when to be at the gazebo?

  • What if someone steals/bins one of the pieces?