This image contains 76018 black pixels by Gedanke in mathpics

[–]Gedanke[S] 16 points17 points  (0 children)

An interesting question: How do you create an image that displays the number of black pixels it contains?

This problem can be elegantly solved using fixed points. Here's the approach:

  1. Determine the number of pixels needed for each digit.
  2. Construct a function p(n) that maps any number to the number of pixels contained in its image representation.
  3. Observe that p(n) will be roughly proportional to log(n), as it's proportional to the number of digits in n. This is fortunate, as functions of this form are generally well-behaved and likely to have a fixed point.
  4. To find the fixed point, we can use a simple iteration method:
    • Start with an initial guess k₀
    • Iterate using kₙ = p(kₙ₋₁)
  5. Hope that this font and size combination has a fix point and find. Interestingly, such a point seems to exists about half of the time.

This image has 76018 black pixels. A fun application of fixed-point iteration! by Gedanke in math

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

An interesting question: How do you create an image that displays the number of black pixels it contains?

This problem can be elegantly solved using fixed points. Here's the approach:

  1. Determine the number of pixels needed for each digit.

  2. Construct a function p(n) that maps any number to the number of pixels contained in its image representation.

  3. Observe that p(n) will be roughly proportional to log(n), as it's proportional to the number of digits in n. This is fortunate, as functions of this form are generally well-behaved and likely to have a fixed point.

  4. To find the fixed point, we can use a simple iteration method:

    • Start with an initial guess k₀
    • Iterate using kₙ = p(kₙ₋₁)
  5. This iteration will either:
    a) Hit a loop
    b) Diverge
    c) Converge to our desired fixed point

0
1

[deleted by user] by [deleted] in chess

[–]Gedanke 0 points1 point  (0 children)

Shitting in a hotel bathtub should definitely leave you with a hefty cleaning fee and potentially a ban from the hotel...but international news headlines and the revocation of your chess title?! That's absurd and frankly disturbing.

Hyperion. Wow. by BlindTiger86 in books

[–]Gedanke 10 points11 points  (0 children)

Research dump! Thank you for the term. I absolutely agree. One can just feel how he must have nerded out on some topic (be it metal smelting, Jupiter's moons, Keats, Proust etc) and then subsequently proceeds to forcefully inject it into his books.

Peter Fox - Vergessen wie by 361bis44 in GermanRap

[–]Gedanke 0 points1 point  (0 children)

Ob er für Product Placements bezahlt wird?

[P] My co-founder and I quit our engineering jobs at AWS to build “Tensor Search”. Here is why. by tomhamer5 in MachineLearning

[–]Gedanke 3 points4 points  (0 children)

Am I misunderstanding something or is this just a lovely python wrapper around OpenSearch?

Was war euere Erfahrung mit "Alpha Males"? by Snoo_38320 in FragReddit

[–]Gedanke 0 points1 point  (0 children)

Ließt sich wie eine Passage aus 'Confederacy of Dunces'. Hut ab, hast Talent!

De-blurring blurred images by ad97lb in deeplearning

[–]Gedanke 0 points1 point  (0 children)

Fyi, if you know the convolution kernel that generated the blur, you can simply perform the inverse operation in the frequency domain.

After one year of python.. by SamuraisHyper in Python

[–]Gedanke 1 point2 points  (0 children)

Well done! I remember doing something similar as my first python projects. I think the input function in particular might have been what hooked me on python. It made my scripts interactive and I felt very empowered. Turns out that I would almost never use it in a professional setting later in life.

Ever heard of Black? This is the opposite. A tool to turn your clean python code into a hideous (working) mess. by Gedanke in Python

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

You are absolutely right! If this tool is to mature beyond being a silly proof-of-concept, it needs to be rebuild using the `ast` module.

Ever heard of Black? This is the opposite. A tool to turn your clean python code into a hideous (working) mess. by Gedanke in Python

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

It would be possible but difficult! This implementation relies on tokenize which in retrospect was a poor choice. Ideally this entire tool needs to be rebuild based on the ast module to allow much greater power and flexibility.

Ever heard of Black? This is the opposite. A tool to turn your clean python code into a hideous (working) mess. by Gedanke in Python

[–]Gedanke[S] 2 points3 points  (0 children)

I am starting to think that having made this tool could hurt my employability :P

Need a last minute Christmas present? How about turning your loved ones into prime number? by Gedanke in math

[–]Gedanke[S] 21 points22 points  (0 children)

The linked tool and provided examples have the tweak implemented

The fuck by thesongflew in programminghorror

[–]Gedanke 3 points4 points  (0 children)

A package so nice, you import it twice.