Cody

Problem 44310. Digit concentration in Champernowne's constant

Solution 1323603

Submitted on 1 Nov 2017 by Elmar Zander
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
d = 1; x = 1; y_correct = 1; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 1

2   Pass
d = 10; x = 5; y_correct = 0.1000; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.1000

3   Pass
d = 10; x = 1; y_correct = 0.2000; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.2000

4   Pass
d = 20; x = 9; y_correct = 0.0500; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.0500

5   Pass
d = 50; x = 0; y_correct = 0.0400; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.0400

6   Pass
d = 50; x = 2; y_correct = 0.2600; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.2600

7   Pass
d = 1000; x = 9; y_correct = 0.0670; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.0670

8   Pass
d = 1e4; x = 8; y_correct = 0.0747; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.0747

9   Pass
d = 1e5; x = 7; y_correct = 0.0864; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.0864

10   Pass
d = 1e6; x = 6; y_correct = 0.0935; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.0935

11   Pass
d = 1e6; x = 5; y_correct = 0.0937; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.0937

12   Pass
d = 2e6; x = 4; y_correct = 0.0903; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.0903

13   Pass
d = 2000124; x = 3; y_correct = 0.1162; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

ans = 0.1162
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://de.mathworks.com/matlabcentral/cody/problems/44310-digit-concentration-in-champernowne-s-constant/solutions/1323603", "fetch_time": 1579722629000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2020-05/segments/1579250607407.48/warc/CC-MAIN-20200122191620-20200122220620-00386.warc.gz", "warc_record_offset": 402882654, "warc_record_length": 15865, "token_count": 715, "char_count": 1624, "score": 3.578125, "int_score": 4, "crawl": "CC-MAIN-2020-05", "snapshot_type": "latest", "language": "en", "language_score": 0.394450306892395, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00023-of-00064.parquet"}