Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution1: [0, 1]均匀取点,单调序列的期望长度 #70

Merged
merged 9 commits into from
Aug 23, 2024

Conversation

Alex222222222222
Copy link
Contributor

@Alex222222222222 Alex222222222222 commented Aug 22, 2024

增加了对于Issue #54 的一个解法。

Summary by CodeRabbit

  • New Features

    • Introduced two comprehensive documents titled "Expectation of Length of Maximum Monotone Sequence," detailing the expected length of the longest increasing subsequence.
    • Documents are available in both English and Chinese, providing thorough mathematical definitions and derivations.
  • Documentation

    • Added a navigation entry for the new documents, improving accessibility and expanding users' understanding of monotone sequences in probability theory.

Copy link

coderabbitai bot commented Aug 22, 2024

Walkthrough

A new document titled "Expectation of Length of Maximum Monotone Sequence" has been introduced, detailing the mathematical exploration of the expected length of the longest increasing subsequence in sequences selected from the interval [0,1]. It includes definitions, mathematical frameworks, derivations of expected values, and comprehensive explanations in both English and Chinese. Additionally, an entry has been added to the navigation structure for easier access.

Changes

Files Change Summary
docs/misc/54_expectation_of_length_of_maximum_monotone_sequence.md, docs/misc/1_expectation_of_length_of_maximum_monotone_sequence.md Introduced new documents that define the problem, outline mathematical frameworks, derive the expected value of the longest increasing subsequence, and include bilingual explanations.
mkdocs.yml Added a new entry in the navigation structure linking to the document on the expectation of length of maximum monotone sequences.

Poem

In fields of math where numbers dance,
A sequence grows, a lovely chance.
From zero to one, we find our way,
Monotone lengths in bright array.
With every hop, a value to see,
Oh joy, oh joy, in math we’re free! 🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (3)
docs/misc/54_expectation_of_length_of_maximum_monotone_sequence.md (3)

1-2: Consider adding an introduction or abstract.

The document starts directly with the problem statement. Adding a brief introduction or abstract could provide context and help readers understand the purpose and scope of the document.


35-45: Clarify the tip section.

The tip section provides a hint about the probability of the sequence stopping at $n$. Consider expanding this section with additional context or examples to enhance understanding.


50-137: Consider breaking down complex mathematical explanations.

The solution section contains complex mathematical derivations. Consider breaking down these explanations into smaller, more digestible parts, possibly with intermediate steps or additional commentary.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 19a1f9b and 93beb39.

Files selected for processing (1)
  • docs/misc/54_expectation_of_length_of_maximum_monotone_sequence.md (1 hunks)
Additional comments not posted (3)
docs/misc/54_expectation_of_length_of_maximum_monotone_sequence.md (3)

5-19: Ensure consistency in mathematical notation.

The English section uses mathematical notation consistently, but ensure that all symbols and terms are defined before use. For example, clarify the meaning of $\sup$ in the context of this problem.


21-33: Verify the accuracy of the Chinese translation.

Ensure that the Chinese translation accurately reflects the English content, especially in mathematical expressions and terminology.


139-214: Ensure parallel structure in bilingual sections.

The Chinese section should mirror the English section in structure and content. Verify that both sections provide the same information and follow the same logical flow.

@shenxiangzhuang
Copy link
Owner

@Alex222222222222 感谢贡献,非常清晰严谨的解答!

除了上述提出的两处笔误。能否麻烦再做如下几处修改(抱歉这些没有在contributing写明,后续会补充上去):

  1. 将文件名命名为1_expectation_of_length_of_maximum_monotone_sequence.md, 也就是将54改为1
  2. mkdocs.yml文件下新增当前题目的目录,示例代码如下(题目也可以考虑精简一些):
   - Miscellaneous:
     - misc/index.md
+    - "1. Expectation of Length of Maximum Monotone Sequence": misc/1_expectation_of_length_of_maximum_monotone_sequence.md

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 93beb39 and e799617.

Files selected for processing (1)
  • docs/misc/54_expectation_of_length_of_maximum_monotone_sequence.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • docs/misc/54_expectation_of_length_of_maximum_monotone_sequence.md

@Alex222222222222
Copy link
Contributor Author

@Alex222222222222 感谢贡献,非常清晰严谨的解答!

除了上述提出的两处笔误。能否麻烦再做如下几处修改(抱歉这些没有在contributing写明,后续会补充上去):

  1. 将文件名命名为1_expectation_of_length_of_maximum_monotone_sequence.md, 也就是将54改为1
  2. mkdocs.yml文件下新增当前题目的目录,示例代码如下(题目也可以考虑精简一些):
   - Miscellaneous:
     - misc/index.md
+    - "1. Expectation of Length of Maximum Monotone Sequence": misc/1_expectation_of_length_of_maximum_monotone_sequence.md

已经修改了。关于题目,我个人也想了挺久,主要希望在题目中包含更多一点的信息,暂时还没有想到更精简一点题目。

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e799617 and f527e7f.

Files selected for processing (2)
  • docs/misc/1_expectation_of_length_of_maximum_monotone_sequence.md (1 hunks)
  • mkdocs.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • mkdocs.yml
Additional comments not posted (3)
docs/misc/1_expectation_of_length_of_maximum_monotone_sequence.md (3)

3-33: Clear and well-structured problem statement.

The problem statement is well-defined in both English and Chinese, with appropriate use of mathematical notation.


35-45: Concise and helpful tip.

The tip provides a useful hint for solving the problem in both English and Chinese.


48-214: Comprehensive and well-explained solution.

The solution is detailed and includes all necessary steps and calculations in both English and Chinese.

@shenxiangzhuang shenxiangzhuang changed the title [0, 1]均匀取点,单调序列的期望长度 Solution: [0, 1]均匀取点,单调序列的期望长度 Aug 23, 2024
@shenxiangzhuang
Copy link
Owner

感谢及时的修复! 这道题目还有另外一个解法,也是一个比较巧妙的方法,后面我会提交上去,到时候会pin下你哈,可以参考看下。

@shenxiangzhuang shenxiangzhuang merged commit 3c9d486 into shenxiangzhuang:master Aug 23, 2024
3 checks passed
@shenxiangzhuang shenxiangzhuang changed the title Solution: [0, 1]均匀取点,单调序列的期望长度 Solution1: [0, 1]均匀取点,单调序列的期望长度 Aug 23, 2024
@Alex222222222222
Copy link
Contributor Author

感谢及时的修复! 这道题目还有另外一个解法,也是一个比较巧妙的方法,后面我会提交上去,到时候会pin下你哈,可以参考看下。

感谢。看了你的证法。可能我个人对于数学证明有些picky。对于 $X_i$ 的定义一开始我比较困惑,因为,题目中 $X$ 是一个space,而你的定义中 $X_i$ 更像是对于一个sequence的函数或者是random variable,所以我更加倾向于 $l_i$ 或者 $f_i$

- $X_i=1$: The sequence remains strictly increasing before the $i$-th element
- $X_i=0$: The sequence is no longer strictly increasing before the $i$-th element

Consider the space $X = [0,1]^\mathbb{N}$, where a probability measure $p$ is defined by selecting a sequence of points uniformly from the interval $[0,1]$. And given function $f: X \rightarrow [0,1]$ as:

另,$L$ 的定义和题目中 $f$ 的定义重复了。

Define the sequence length $L$ as the number of $X_i$ that are 1, i.e., the number of elements before the sequence stops being strictly increasing.

$$
f(\gamma) = \sup \{
n \in \mathbb{N} \mid \gamma_i < \gamma_{i+1}, \forall i < n
\}
$$

@shenxiangzhuang
Copy link
Owner

数学证明这个,我觉着你写的这个证明是很严谨的,完全就是标准答案了。我现在是写不出这种证明了,哈哈。

后面这个定义重复的问题确实没有注意到,我一会来统一下,把 $$L$$ 换成 $$f$$ 吧。

@Alex222222222222
Copy link
Contributor Author

数学证明这个,我觉着你写的这个证明是很严谨的,完全就是标准答案了。我现在是写不出这种证明了,哈哈。

后面这个定义重复的问题确实没有注意到,我一会来统一下,把 L 换成 f 吧。

哈哈,现役数学人表示,受了几年的专业训练,然后开始对证明特别picky。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants