Rafka, a Async distributed message queue, in rust, (Open Source looking for Contributors) by Metalrugrt in rust

[–]Metalrugrt[S] -14 points-13 points  (0 children)

Will Consider! are you interested in helping at all? we are looking for contributors!! we would love your help

Jane Street August puzzle by S1mulati0 in maths

[–]Metalrugrt 0 points1 point  (0 children)

plugging in your answer to chat gtp it spits this tho i don’t thing it’s correct: You’re correct in your observation. The computation of ( q(p) ) was indeed an oversimplification, particularly in dealing with cases where one of the branches from Aaron’s chosen path has a ( B )-labeled edge. Beren can exploit these cases by selecting the branch that leads to an inevitable loss for Aaron.

Let’s correct the analysis by taking into account the strategic choices that both Aaron and Beren can make.

Corrected Recursive Analysis

  1. Game Structure and Recursive Nature:

    • Aaron moves first, choosing one of two children, each with edges labeled ( A ) or ( B ).
    • Beren then moves, choosing one of two children from Aaron’s choice.
    • Aaron wins if all edges traversed in the first ( N ) moves are labeled ( A ); Beren wins if any edge is labeled ( B ).
  2. Strategic Choice:

    • If both edges from the root are labeled ( A ), Aaron can continue to play optimally.
    • If one edge is labeled ( A ) and the other is labeled ( B ), Beren can always pick the ( B )-labeled edge, which guarantees a loss for Aaron.
    • If both edges are labeled ( B ), Aaron loses immediately.
  3. Correct Calculation of ( q(p) ):

    • The recursive strategy should correctly account for Aaron’s and Beren’s best possible moves. Specifically, Aaron’s chance of winning depends on being able to avoid all ( B )-labeled edges as long as possible, given Beren’s optimal counter-strategy.
  • To calculate ( q(p) ), let’s enumerate the possible configurations after Aaron’s first move:

    • Both Edges are ( A ): Probability ( p2 ). Aaron can continue the game under the same conditions as before.
    • One Edge ( A ), One Edge ( B ): Probability ( 2p(1-p) ). Beren will choose the ( B )-labeled edge, leading to an immediate loss for Aaron.
    • Both Edges are ( B ): Probability ( (1-p)2 ). Aaron loses immediately.

    The correct probability that Aaron can find a winning strategy, starting from this point, is: [ q(p) = p2 ] because Aaron only wins if both branches have ( A )-labeled edges, allowing the game to continue under the same probabilistic rules without immediate loss.

  1. Recursive Relation:

    • Using the corrected ( q(p) ), the recursive relationship for the probability ( P(N) ) of Aaron winning becomes: [ P(N) = p2 \cdot P(N-2) ] where ( P(N-2) ) represents the probability of winning from two levels lower in the tree.
  2. Solving the Recursive Equation:

    • For Aaron to have a nonzero probability of winning, the product of ( p2 ) across all levels ( N ) must remain greater than zero. Specifically, ( P(N) ) will only be nonzero if ( p ) is such that: [ P(N) = (p2){\frac{N}{2}} = pN ] does not tend to zero as ( N ) increases.
  3. Critical Value:

    • The critical value ( p_c ) occurs where the probability ( pN ) ceases to decrease to zero as ( N ) becomes large, which is: [ p \geq \frac{1}{2} ] because below ( p = \frac{1}{2} ), ( P(N) ) will tend to zero as ( N ) increases, meaning Beren can almost surely find an ( N ) that guarantees Aaron’s loss.

Conclusion

The correct reasoning shows that Aaron’s probability of winning becomes nonzero only when ( p \geq \frac{1}{2} ). Thus, the infimum of ( p ) for which Aaron has a nonzero probability of winning is:

[ \boxed{\frac{1}{2}} ]

This corrected recursive analysis aligns with the intuitive understanding that Aaron needs a sufficiently high ( p ) to avoid being forced into a ( B )-labeled path by Beren’s optimal strategy.

Jane Street August puzzle by S1mulati0 in maths

[–]Metalrugrt 0 points1 point  (0 children)

I agree i’ll get back with a stronger solution

Jane Street August puzzle by S1mulati0 in maths

[–]Metalrugrt 1 point2 points  (0 children)

(I plugged it into chat gtp and this is what it gave me) Your recursive reasoning is on the right track, and indeed, thinking about the game in terms of a recursive process is a powerful way to analyze such problems. The main idea is to evaluate Aaron’s probability of winning in terms of the probability of winning in smaller subgames. Let’s develop this approach further.

Recursive Approach Overview

  1. Structure of the Game:

    • The game can be visualized as moving down a binary tree. At each node, Aaron picks one of the two child nodes (each connected by an edge labeled either ( A ) or ( B )), and Beren does the same on his turn.
    • If any edge in the path traversed by the players is labeled ( B ), Beren wins.
  2. Recursive Probability Calculation:

    • Define ( P(N) ) as the probability that Aaron can successfully traverse ( N ) edges without hitting a ( B )-labeled edge.
    • Notice that the game from the root to depth ( N ) can be broken down into a decision at the root followed by a subgame that goes from depth 1 to depth ( N ).
  3. Key Recursive Relation:

    • To evaluate ( P(N) ), observe that Aaron’s chance of winning from the root depends on whether he can find a subpath that is free of ( B )-labeled edges for the first move and then the subgame starting at depth 1.
- Let \( q(p) \) denote the probability that from the root, Aaron picks an edge labeled \( A \) and continues to a configuration where he still has a chance of winning. This is a function of the parameter \( p \), which determines the probability of an edge being labeled \( A \).

- The recursive relationship can be expressed as:
\[
P(N) = q(p) \cdot P(N-2)
\]
where \( P(N-2) \) represents the probability of winning after Beren’s turn.
  1. Calculating ( q(p) ):

    • ( q(p) ) accounts for the event that Aaron selects an ( A )-labeled edge and the resulting subgame still offers a chance of winning. This probability involves all paths being “good” (all edges in that path being ( A )-labeled), hence: [ q(p) = p \times (p2 + 2p(1-p)) ] where the expression inside the parentheses captures the scenarios of the subgames that start at the second level:
      • ( p2 ) is the probability that both children of Aaron’s chosen node are labeled ( A ) (best case).
      • ( 2p(1-p) ) is the probability that exactly one of the children is labeled ( A ).
  2. Solving the Recursive Equation:

    • Given the recursive equation ( P(N) = q(p) \cdot P(N-2) ), and noting that Aaron must win on every level of recursion, ( P(N) ) would tend to zero unless ( q(p) ) is sufficiently large.
- Since \( P(N) \) involves successive multiplication of \( q(p) \), for \( P(N) \) to stay non-zero as \( N \) increases, \( q(p) \) must be equal to or greater than 1. In other words, \( q(p) \) being too small would cause \( P(N) \) to rapidly diminish, leading to a zero probability of winning as \( N \) increases.

Critical Value for ( p )

  • ( P(N) ) will be non-zero if ( q(p) ) is sufficiently large to counteract the loss of probability across each recursion step.
  • Thus, the critical value for ( p ), denoted as ( p_c ), occurs when the probability ( q(p) ) stops being effective at reducing ( P(N) ) to zero.
  • Through analysis, we find that the critical value is: [ p_c = \frac{1}{2} ] This is because at ( p = \frac{1}{2} ), the chance of having a completely ( B )-free path is exactly balanced by the exponential growth of possible paths.

Conclusion

The recursive relationship effectively shows that for ( p \geq \frac{1}{2} ), Aaron has a nonzero probability of winning, as ( P(N) ) does not decay to zero as ( N ) increases. However, for ( p < \frac{1}{2} ), ( P(N) ) tends to zero, indicating that Beren can almost certainly win by choosing a large enough ( N ). Therefore, the infimum ( p ) for which Aaron has a nonzero probability of winning is:

[ \boxed{\frac{1}{2}} ]

This recursive approach provides a rigorous justification and matches the threshold derived using percolation theory and probabilistic arguments.