Hacker Newsnew | past | comments | ask | show | jobs | submit | melonmouse's commentslogin

Great idea! It also works on the side of the board, I couldn't help building it out: https://onemillionchessboards.com/#4363,6


The linked proof for that median of medians is O(n) feels counterintuitive to me. Here's a (simpler?) alternative.

  T(0) = 0
  T(1) = 1
  T(n) = n + T(n/5) + T(7/10*n)
We want to prove that:

  T(n) ≤ C*n
It is intuitive that T(a+b) ≥ T(a) + T(b), or in other words, T is superadditive. That can be shown by induction:

Induction base: it holds for all a+b < 1, the only case being a=0, b=0:

  T(0+0) = 0 + T(0) + T(0) ≥ T(0) + T(0)
Induction step: suppose it holds for all a+b < k. Let a+b = k.

  T(a+b) = T(k)
         = k + T(k/5) + T(7/10*k)
         ≥ k + T(a/5) + T(b/5) + T(7/10*a) + T(7/10*b)
         = [a + T(a/5) + T(7/10*a)] + [b + T(b/5) + T(7/10*b)]
         = T(a) + T(b)
Because T is superadditive:

  T(n) = n + T(n/5) + T(7/10*n)
       ≤ n + T(n/5 + 7/10*n)
       = n + T(9/10*n)
Now we can apply the master theorem. Or to write out the proof (using a geometric series):

  T(n) ≤ n + T(9/10*n)
       ≤ n * ∑ᵢ₌₀ᶦⁿᶠᶦⁿᶦᵗʸ (9/10)^i
       = n * 1/(1-9/10)
       = 10*n
So, we have shown the algorithm is O(n) with C=10 (or less).


I like the idea to use super additivity, but in a proof you cannot creatively extend T to the reals, this should be fixed.

Here is the slightly mopped up proof i had in mind, when i posted my hints below:

  Let be r>=1 and 0<a(i) for all 1<=i<=r and 1/a(1) + ... + 1/a(n) =: s < 1.
  Then a(i) > 1 for all 1 <= i <= r. 

  Let be c > 0 and
  T(0) := 0
  T(n) := c \* n + T(floor(n/a(1))) + ... + T(floor(n/a(r)))

  Then T(n) <= b * n for all n with b := c/(1-s) > 0 !
  Proof by induction: 
  "n=0" : 
   The statement holds trivially.

  "k->n": 
   Let n>=1 and assume the statement holds for all 0<=k<n. 
   Now since a(i)>1 we have floor(n/a(i)) <= n/a(i) < n. By the induction hypothesis therefore
   T(floor(n/a(i))) <= b * floor(n/a(i)) <= b * n/a(i). 
   Apply this to get:
   T(n) =  c * n + T(floor(n/a(1))) + ... + T(floor(n/a(r)))
        <= c * n + b * n/a(1) + ... +  b * n/a(r)
        = (c + b*s) * n
        = b * n.
   Hence T(n) <= b * n.


As a joke, I made a webpage where you can do attribution to ALL GitHub repositories:

http://thanksforthecode.com

It scrolls past all the repos movie-credits-style. Doing it that way takes several days! It shows how abstract and absurd giving contribution to such a large body of works is.


You're missing your <noscript> tag


Who should we thank for the code written by Copilot? In a way, we should thank everyone in the training data. That includes: everyone with a public Github repository.

Context: https://github.com/usewits/ThanksForTheCode

You can customize it like this: thanksforthecode.com?name=PROJECT_NAME


Another funemployed xoogler here! I've been making games for the last year, and one thing I would definitely love to explore is designing a deep but easy to learn game using learning techniques. We should talk!

You can reach me on: melonmousegames@gmail.com


> This is factually wrong, looks at CO2 emissions per capita, USA has carbon footprint double that of France.

It's closer to 3x: USA 15.7 vs France 5.2 tonnes of CO2 per capita per year (2017, not accounting for other gasses that contribute to warming) [1]

[1] https://en.wikipedia.org/wiki/List_of_countries_by_carbon_di...


Any idea how much nuclear power has contributed to this discrepancy?

I.e., if the US had the same per capita nuclear power generation as France, what would the numbers look like?


I'd guess transportation plays a bigger role, but not sure.

US emissions are ~29% transportation and ~27% electricty generation [1]. The US uses ~13x as much oil [2].

Natural Gas isn't particularly dirty. Coal and petroleum only make up 24% of power generation in the US [3]. Fossil fuels make up ~9% of electricity production in France [4].

[1] https://images.app.goo.gl/9YFsuN9vjkiiZnek9

[2] https://en.wikipedia.org/wiki/List_of_countries_by_oil_consu...

[3] https://www.eia.gov/energyexplained/electricity/electricity-....

[4] https://en.wikipedia.org/wiki/Electricity_sector_in_France#:...).


>Natural Gas isn't particularly dirty

Just a small nit but the OP was referencing CO2. Natural gas is cleaner than other fossil fuels. “Clean” != low carbon (although it’s lower than other fossil fuels)


I would expect our spread out nature to contribute to that a lot. We drive a lot (and often environmentally unfriendly vehicles). Our food chain also involves shipping food substantial distances (not sure how true that is of Europe).


Sprawl takes a lot of resources to sustain


I wonder how much efficiency and resiliency are competing interests in the supply chain. From one perspective, consolidation creates a more efficient system due to economies of scale. On the other hand, distributed systems tend to be more reliable, but less efficient


I made a game about polyominoes: https://melonmouse.itch.io/polyominoes

If you try it out, please let me know what you think :)

P.S. work on that led to a sequence on the Online Encyclopedia of Integer Sequences: https://oeis.org/A239658


One QOL consideration: consider allowing the last placed piece to be moved in one click. That is, if you click while "at capacity" the last placed piece gets removed and placed where you click.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: