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

asymptotic expansion generator for binomial(kn, n) #19510

Closed
dkrenn opened this issue Nov 1, 2015 · 33 comments
Closed

asymptotic expansion generator for binomial(kn, n) #19510

dkrenn opened this issue Nov 1, 2015 · 33 comments

Comments

@dkrenn
Copy link
Contributor

dkrenn commented Nov 1, 2015

Implement a generator for binomial(k*n, n).

Depends on #19306
Depends on #19521
Depends on #19528
Depends on #19957

CC: @behackl @cheuberg

Component: asymptotic expansions

Author: Daniel Krenn

Branch/Commit: c998922

Reviewer: Clemens Heuberger

Issue created by migration from https://trac.sagemath.org/ticket/19510

@dkrenn dkrenn added this to the sage-6.10 milestone Nov 1, 2015
@dkrenn
Copy link
Contributor Author

dkrenn commented Nov 1, 2015

Branch: u/dkrenn/asy/generators-binomial

@dkrenn
Copy link
Contributor Author

dkrenn commented Nov 4, 2015

Commit: 221ad4f

@dkrenn
Copy link
Contributor Author

dkrenn commented Nov 4, 2015

Changed dependencies from #19306 to #19306, #19521

@dkrenn
Copy link
Contributor Author

dkrenn commented Nov 4, 2015

Last 10 new commits:

f0c7440use symbolic constants subring (instead of SR)
0d6cce3remove automatic parenthesing in parent_to_repr_short
3f5e1b1fix bug in split_str_by_op
6e366a5binomial_kn_n: change to symbolic constants subring (WIP)
ae1877crename binomial* --> Binomial*
f0ab41adelete code of binomial* since it was
559d1c4Merge branch 't/19306/asy/generators' into asy/generators-binomial
fd35046change base class to SageObject
532c41cwrite docstrings of Stirling generators
221ad4fMerge branch 't/19306/asy/generators' into asy/generators-binomial

@dkrenn
Copy link
Contributor Author

dkrenn commented Nov 4, 2015

Changed dependencies from #19306, #19521 to #19306, #19521, #19528

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 5, 2015

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

a2b744dMerge branch 'coerce/inverse-action' into asy/generators-binomial
1bd2223make Binomial_kn_n really working
421e377mutable poset map: remove elements ``None``
1d28240term monoid: write change_parameter
2c37889correct a bug in change_parameter
bdcb72bwrite map_coefficients
2a0815dMerge branch 'asy/map_coefficients' into asy/generators-binomial
e93ce46simplify coefficients automatically and use the faster algorithm per default
f468de6docu
4a27e66result over QQ if skip-parameter given

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 5, 2015

Changed commit from 221ad4f to 4a27e66

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 5, 2015

Changed commit from 4a27e66 to e59c71f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 5, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

e59c71ftoc entry (at top of file)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 7, 2015

Changed commit from e59c71f to ea3dd35

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 7, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

ea3dd35small bugfix

@cheuberg
Copy link
Contributor

@cheuberg
Copy link
Contributor

Changed commit from ea3dd35 to 1529a4d

@cheuberg
Copy link
Contributor

comment:9

Merged latest version of #19306 to avoid doctest failure.


New commits:

cc256c8Trac #19306: remove old code
31e4dc4Trac #19306: other variables than n
a3fad56Trac #19306: fix error terms for low precision
a4c3f9dTrac #19306: Fix low precision for Stirling
eac4977Trac #19306: minor changes (cross-review and incorporate reviewer comments)
946a828Trac #19306: change % to .format
809d653Trac #19306: Merge tag '7.0' due to #19879
4d80eb3Trac #19306: sage.rings.arith -> sage.arith.all (after #19879)
1529a4dTrac #19510: Merge #19306 (due to #19879)

@cheuberg cheuberg modified the milestones: sage-6.10, sage-7.1 Jan 22, 2016
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 23, 2016

Changed commit from 1529a4d to 5d9152c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 23, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

3e30659Trac #19510: modify constant factor: factor sqrt(k-1) is removed, too.
5d9152cTrac #19510: state constant factors/summands in Stirling and binomial

@cheuberg
Copy link
Contributor

Reviewer: Clemens Heuberger

@cheuberg
Copy link
Contributor

comment:11

Reviewed the code (without its dependency #19521) and the documentation, but did not yet verify the final output of the doctests. I had to modify the "constant factor" in order to get rational coefficients when k-1 is not a square.

I am not happy with the growth group of the output:

  • (e<sup>(n*log(n)))</sup>(Symbolic Constants Subring) will never occur.
  • log(n)^(Symbolic Constants Subring) will never occur.
  • (e<sup>n)</sup>(Symbolic Constants Subring) is hard to read; actually, the only exponential factor that will ever occur is (k<sup>k/(k-1)</sup>(k-1))^n, so FractionField(k.parent())^n would be enough (so QQ^n in all examples). However, it is not clear to me how to implement this without pain.

@dkrenn
Copy link
Contributor Author

dkrenn commented Jan 26, 2016

@dkrenn
Copy link
Contributor Author

dkrenn commented Jan 26, 2016

comment:13

Replying to @cheuberg:

Reviewed the code (without its dependency #19521) and the documentation, but did not yet verify the final output of the doctests. I had to modify the "constant factor" in order to get rational coefficients when k-1 is not a square.

I am not happy with the growth group of the output:

  • (e<sup>(n*log(n)))</sup>(Symbolic Constants Subring) will never occur.
  • log(n)^(Symbolic Constants Subring) will never occur.
  • (e<sup>n)</sup>(Symbolic Constants Subring) is hard to read; actually, the only exponential factor that will ever occur is (k<sup>k/(k-1)</sup>(k-1))^n, so FractionField(k.parent())^n would be enough (so QQ^n in all examples). However, it is not clear to me how to implement this without pain.

More or less complete rewrite of function.


Last 10 new commits:

1b62954Trac #19946: add doctests to document behavior
24c153cTrac #19946: reviewer commit: ReSt error
7918417Trac #19946: additional doctest
1471336Trac #19946: rewrite and improve explaination of 1b62954
9f9a23fTrac #19961: document rpow
101e4deMerge branch 'u/dkrenn/t/19961' of trac.sagemath.org:sage into t/19946
7179c78Trac #19946: link from general doc to detailed explaination
1259201Trac #19946: fix typo
37caf25Merge branch 'u/cheuberg/t/19946' of trac.sagemath.org:sage into t/19510/asy/generators-binomial
10cd04bTrac #19510: major rewrite of binomial kn over n

@dkrenn
Copy link
Contributor Author

dkrenn commented Jan 26, 2016

Changed commit from 5d9152c to 10cd04b

@cheuberg
Copy link
Contributor

@cheuberg
Copy link
Contributor

comment:15

I reviewed this version.

I merged #19957 and added doctests using compare_with_values. Please cross-review and set to positive if you are satisfied.


Last 10 new commits:

7337e61Trac 19957 review: restructure part of the code and remove inner list to make it better readable
0632fd3Trac 19957 review: minor changes in doc
4a8ea9aTrac #19957: move see also blocks to position given in developer guide
9ea47b9Trac #19957: fix dead link
3d51289Trac #19957: Merge #19946 to avoid work-around
b606fdfTrac #19957: remove work-around for #19946
4346994Trac #19957: rename e to expansion in doctests
5d6e9b2Trac #19957: Introduce parameter relative tolerance
00eae5dMerge branch 't/19957/asy/compare-with-values' into t/19510/asy/generators-binomial
78bdd0fTrac #19510: additional doctests using compare_with_values

@cheuberg
Copy link
Contributor

Changed commit from 10cd04b to 78bdd0f

@cheuberg
Copy link
Contributor

Changed dependencies from #19306, #19521, #19528 to #19306, #19521, #19528, #19957

@vbraun
Copy link
Member

vbraun commented Jan 29, 2016

comment:17

http://build.sagedev.org/release/builders/%20%20fast%20Oxford%20arando%20%28Ubuntu%2013.04%20i686%29%20incremental/builds/797/steps/shell_4/logs/stdio

sage -t --long src/sage/rings/asymptotic/asymptotic_expansion_generators.py
**********************************************************************
File "src/sage/rings/asymptotic/asymptotic_expansion_generators.py", line 141, in sage.rings.asymptotic.asymptotic_expansion_generators.AsymptoticExpansionGenerators.Stirling
Failed example:
    expansion.compare_with_values(n, lambda x: x.factorial(), [5, 10, 20])
Expected:
    [(5, 0.00675841118?), (10, 0.0067589306?), (20, 0.006744925?)]
Got:
    [(5, 0.006758411181?), (10, 0.0067589306?), (20, 0.006744925?)]
**********************************************************************
1 item had failures:
   1 of  11 in sage.rings.asymptotic.asymptotic_expansion_generators.AsymptoticExpansionGenerators.Stirling
    [45 tests, 1 failure, 8.78 s]

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 30, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

2b71379Trac #19510: specify relative tolerance for doctests

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 30, 2016

Changed commit from 78bdd0f to 2b71379

@cheuberg
Copy link
Contributor

comment:19

Added relative tolerance.

@dkrenn
Copy link
Contributor Author

dkrenn commented Jan 30, 2016

@dkrenn
Copy link
Contributor Author

dkrenn commented Jan 30, 2016

New commits:

c998922Trac #19510: constitent spacings

@dkrenn
Copy link
Contributor Author

dkrenn commented Jan 30, 2016

Changed commit from 2b71379 to c998922

@vbraun
Copy link
Member

vbraun commented Jan 31, 2016

Changed branch from u/dkrenn/asy/generators-binomial to c998922

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

No branches or pull requests

3 participants