Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue37128

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Add math.perm()
Type:enhancementStage:resolved
Components:Library (Lib)Versions:Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: lemburg, mark.dickinson, rhettinger, serhiy.storchaka, stutzbach
Priority:normalKeywords:patch

Created on2019-06-01 20:47 byserhiy.storchaka, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 13731mergedserhiy.storchaka,2019-06-01 20:49
Messages (4)
msg344226 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-06-01 20:47
The function which returns the number of ways to choose k items from n items without repetition and without order was added inissue35431. This functions is always goes in pair with other function, which returns the number of ways to choose k items from n items without repetition and with order. These functions are always learned together in curses of combinatorics. Often C(n,k) is determined via P(n,k) (and both are determined via factorial).    P(n, k) = n! / (n-k)!    C(n, k) = P(n, k) / k!The proposed PR adds meth.perm(). It shares most of the code with math.comb().
msg344227 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-06-01 20:49
+0 from me.  It is inevitable that this will be requested now that we have comb().  The need for this is much less though.
msg344228 -(view)Author: Mark Dickinson (mark.dickinson)*(Python committer)Date: 2019-06-01 20:54
> +0 from me.  It is inevitable that this will be requested now that we have comb().Exactly my thoughts, too. I don't think I'll have any use for `math.perm`; the main reason to add it will be to satisfy all those who got taught combinations and permutations at the same time, see them as a unit, and then get surprised when they find `math.comb` without `math.perm`.The good part is that now that we have math.comb, I think everything about the API of math.perm is already clear (including what to call it).
msg344259 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-06-02 08:17
New changeset5ae299ac78abb628803ab7dee0997364547f5cc8 by Serhiy Storchaka in branch 'master':bpo-37128: Add math.perm(). (GH-13731)https://github.com/python/cpython/commit/5ae299ac78abb628803ab7dee0997364547f5cc8
History
DateUserActionArgs
2022-04-11 14:59:16adminsetgithub: 81309
2019-06-02 08:53:41serhiy.storchakasetresolution: fixed
2019-06-02 08:53:34serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
2019-06-02 08:17:04serhiy.storchakasetmessages: +msg344259
2019-06-01 20:54:40mark.dickinsonsetmessages: +msg344228
2019-06-01 20:49:22serhiy.storchakasetkeywords: +patch
stage: patch review
pull_requests: +pull_request13615
2019-06-01 20:49:09rhettingersetnosy: +rhettinger
messages: +msg344227
2019-06-01 20:47:29serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp