Fun exercise: Write a Haskell function `update :: Tree a → [a] → Maybe (Tree a)`, that updates the leaves of a Tree by those given in a list (if there are not enough, return Nothing). My attempt after CW
pop :: Compose (State [a]) Maybe a
pop = Compose $ do
xs <- get
modify' (drop 1)
pure (listToMaybe xs)
update = evalState . getCompose . go
go (Node _ ) = pure <$> pop
go (Node x ts) = Node x <$> traverse go ts
Me hice hace un tiempo una lista de ideas para TFG para mates/info y me la he vuelto a encontrar. Como a mí ya no me va a servir, voy a retocarla un momento y cederla al mundo. Si alguien se anima con algo de esto porfa que me escriba que me va a hacer ilusión y tengo bibliografía de casi todo por ahí.
"I was quite surprised as well to not find this hierarchy in the literature, so I wrote my graduate thesis about it" https://cstheory.stackexchange.com/questions/39260
How do I make base phi a meme?
There are 10 types of people: 1 that is easily understood and the other 0.1 that's completely irrational
original source for the image (birdsite link)
The friends win if any of them writes down the number on their own forehead. If none of them manage to do so, then the demon wins.
To motivate them we may assume that if the friends win then they all receive a small prize such as cupcakes. Otherwise the demon will keep the cupcakes and the friends will not get any.
Under what circumstances can the friends win?
I am inspired by a toot of @mx_psi to write down a puzzle I heard last year from a friend.
Three friends are standing around when a demon appears and writes a real number on each one's forehead (they have large foreheads). The demon then invites each of them to write down a finite list of real numbers on a piece of paper. The friends may see each other's foreheads, but must not communicate otherwise. All three simultaneously reveal their papers. (1/2)
@JordiGH weird things happen in axiomatic set theories where AC is true and where AC is false or doesn't hold. I think the problem is we don't have a good intuition about infinite sets in general.
Math & computer science student (undergraduate) from Spain. I like theoretical computer science and puns.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!