43 karma · joined Dec 11, 2014 (11y ago) · 36 submissions
comment 7mo ago · link · parent
comment 1y ago · link · parent
11110
-----
11|....0
2|....0
0|00000
0|00000
0|00000
The sequential constraint solver fails here even though the deduction required is trivial. The first row can only be 10010 or else the 2 in the second row isn't possible.A more difficult problem is the following:
11 1
11211
-----
1|..0..
2|..0..
11|.010.
4|.111.
0|00000
There are two choices at this point. One option is: 11 1
11211
-----
1|..0..
2|..0..
11|.010.
4|01111
0|00000
And we immediately run into a problem with the 3rd row, 1st col which needs to be both 1 and 0.The other solves the problem immediately as all remaining squares are immediately specified by a single constraint.
11 1
11211
-----
1|00010
2|11000
11|00101
4|11110
0|00000
Compared to most sudoku solves, I think this is pretty straightforward (you only need to look ahead one move to one other square). I think this would be fair game to give as a problem.Of all the games with a unique solution that the sequential solver can't do that I looked at, almost all fell somewhere in the range of difficulty between these two. I didn't find any that require more than one move lookahead.
comment 1y ago · link · parent
Database generation: 25s; Sequential solver - all 'solvable' problems or abandon: 52s; Backtracking solver - all solutions: 19s; Database Lookup - all solutions: 16s;
Key takeaway is that the backtracker is not only much simpler, its actually much faster (for a computer at least) and almost as fast as looking up the answer in a table.
comment 1y ago · link · parent
To get an idea of the speed difference between solving sequentially vs solving using backtracking, on my 10 year old MacBook Pro running on a single core, solving all 28,781,820 possible distinct games: - sequential solver: ~75s to either solve or abandon each problem - backtracking solver: ~175s (2.3x) to find every solution for every problem
The backtracking solver is unfairly disadvantaged in this comparison as it takes more time to solve the difficult games requiring backtracking and those with multiple solutions - for example the game {1, 1, 1, 1, 1 | 1, 1, 1, 1, 1} has 120 solutions that need to be found, but the sequential solver abandons its attempt after making no progress on its first pass through the constraints.
For the 25,309,575 uniquely determined games only, the gap in performance is a bit narrower: - sequential solver: ~60s - backtracking solver: ~120s (2.0x)
The recursive backtracking solver was a far simpler program to write though!
Incidentally, to generate a database of all possible games took ~35s and finding all solutions for all of the games by looking them up took ~20s in total.
6.
The virtue of being Stupidly Determined(gitlab.com ↗)
3 points · by questerzen · 8y ago · discuss
7.
Monads: A useful tool for the working programmer?(gitlab.com ↗)
9 points · by questerzen · 8y ago · discuss
comment 8y ago · link · parent
To give an example of what to expect, my experience with one particular book on Scientific Python: * most code examples wouldn't run without significant modification, mainly due to missing lines and multiple typos * some of the text was cryptic to the point of absurdity * topic coverage was unstructured, patchy and made no coherent sense overall * the website for the book was broken and I couldn't find any way to feed my corrections back to the author
Clearly Packt put no effort into quality assurance or editing. I would suggest you would be better off waiting for something from a more reliable publisher: such poorly edited books will just waste your time.
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
12.
The Adorkable Misogyny of the Big Bang Theory(m.youtube.com ↗)
2 points · by questerzen · 9y ago · 1 comment
13.
Neats and scruffies (Wikipedia): AI battle lines(en.wikipedia.org ↗)
3 points · by questerzen · 9y ago · discuss
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
Potentiation is a problem though (particularly when combined with brackets) as Python becomes impossibly slow using bignums. (I estimate it will take several days of compute time to test all 250 million possibilities, unless I put some effort into speeding it up significantly.) But at least it would prove definitively whether 10958 is possible.
If the only goal were to search for a solution to 10958 though, it should be fairly straightforward to re-order the search in approximately ascending order of compute cost so that if a simple solution exists it will be found quickly.
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 10y ago · link · parent
For implementation, it's whatever tool best fits the job.
C is a good compromise, but it requires real discipline. The CPython and Linux code bases are great examples of how C can be wielded well in practice. But of course C also famously offers unlimited opportunities to make a complete hash of things. I certainly wouldn't recommend it to anyone as their first and only language.
An alternative approach is to be bilingual. For my current project the final code is in C++98 - sometimes there's no good alternative. But I do most of my experimentation, tooling and prototyping in Python. Python's excellent C/C++ interoperability is a huge benefit in this.
I definitely agree with the article that you shouldn't avoid hard things that improve you. But in choosing between ADA and C, the right answer is both and neither.
comment 10y ago · link · parent
Even though I had come across it before, I had a real revelation when I read David Hestenes short paper on it (from Bret Victor's website) http://worrydream.com/refs/Hestenes-ReformingTheMathematical... It is indeed beautiful to see how complex geometry and vector fields are connected via GA. I found especially revealing the relationship between electric and magnetic fields. I agree with the article that whatever its absolute merits, it would be a good way to teach new physicists. I have already ordered my copy of "Clifford Algebra to Geometric Calculus".
Whether it is actually more practical to do work in General Relativity or Quantum Mechanics, or indeed Quantum Field Theory etc., I'll have to leave for the experts in those fields. From an outsider's perspective, it is a delight to understand some of the connections between different disciplines in a more intuitive way.
In any case, I would imagine that GA is exceptionally useful for computer graphics and physical simulations.
comment 10y ago · link · parent
He has almost every non-fiction book on my Goodreads list: Books Scientists Should Read Before The Age Of 20. https://www.goodreads.com/list/show/75031.Books_Scientists_S...
Forget Amazon recommendations: this is the basis for my 2016 reading list.
Thanks for those that have worked hard to list the books!
comment 10y ago · link · parent
But there is very little evidence that PE or VC funding adds much value to a company through advice or services: the poor performance of post-boom PE funds and their companies, for example, suggests that such claims are vastly exaggerated. I recently had a conversation with the head of a very successful fund who, reflecting on the aftermath of the financial crisis, openly expressed his doubt that his fund had really helped the companies they bought stakes in. He, of course, became exceedingly rich and the steady stream of inflated IPOs produced healthy returns for the funds investors (at least until they didn't.) A large part of the problem is that the compensation model (the traditional "2 and 20") is geared towards the capital providers not the entrepreneurs or indeed to social benefits. Funds are incentivised to raise huge sums of capital from sources who offer nothing but cash and a healthy appetite for risk and over-capitalise the companies they fund (the fund earns 2% on invested external capital regardless of how it performs). To compensate the investors, the funds rely almost exclusively on extracting a very large profit from the few "unicorns" that succeed outrageously (of which the fund gets to keep 20%, or sometimes more). Taking $100 million from a single company is hard to justify, however greatly you value the advice and support you got. And the many worthy productivity-enhancing near-successes are left to flounder. PG may like to focus on the positive impact he is having helping founders succeed, but the reality of his business model is strongly skewed to financial rent extraction.
comment 10y ago · link · parent
comment 11y ago · link · parent
comment 11y ago · link · parent