[npl] / trunk / NationalProblemLibrary / ASU-topics / setSequenceandSeries / factorial2.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/ASU-topics/setSequenceandSeries/factorial2.pg

Wed Feb 22 20:38:15 2006 UTC (7 years, 3 months ago) by jjholt
File size: 1371 byte(s)
Tags as of Feb 22, 2006.
--JH


    1 ##DESCRIPTION
2 ##   Simplify factorials
3 ##ENDDESCRIPTION
4
5 ## KEYWORDS('Sequences and Series')
6 ## Tagged by ynw2d
7
8 ## DBsubject('Algebra')
9 ## DBchapter('Sequences and Series')
10 ## DBsection('Arithmetic Sequences')
11 ## Date('')
12 ## Author('')
13 ## Institution('ASU')
14 ## TitleText1('')
15 ## EditionText1('')
16 ## AuthorText1('')
17 ## Section1('')
18 ## Problem1('')
19 ##KEYWORDS('algebra', 'sequence')
20
21 ##KEYWORDS('factorials')
22
23 #
24 # First comes some stuff that appears at the beginning of every problem
25 #
26
27 DOCUMENT();        # This should be the first executable line in the problem.
28
30 "PG.pl",
31 "PGbasicmacros.pl",
32 "PGchoicemacros.pl",
34 "PGauxiliaryFunctions.pl",
35 "PGasu.pl"
36 );
37
38 TEXT(&beginproblem);
39
40 #
41 # Choose the denominator
42 #
43
44 $b = random(1,30); 45 46 #Pick how many more the numerator will be 47$c = random(1,5);
48
49 #Calculate the numerator
50 $a =$b + $c; 51 52 #calculate the answer 53$ans = $a; 54 for($j=$b+1;$j<$a;$j++) {
55   $ans *=$j;
56 }
57
58 #Now the problem
59
60
61 BEGIN_TEXT
62 Evaluate $\frac{a !}{b !}$
63   $PAR 64 $$\frac{a !}{b !}$$ =\{ans_rule(40)\} 65 END_TEXT 66 67 # 68 # Tell WeBWork how to test if answers are right. These should come in the 69 # same order as the answer blanks above. You tell WeBWork both the type of 70 # "answer evaluator" to use, and the correct answer. 71 # 72 73 &ANS(num_cmp($ans));
74
75 ENDDOCUMENT();        # This should be the last executable line in the problem.
76
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "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": "http://webwork.maa.org/viewvc/npl/trunk/NationalProblemLibrary/ASU-topics/setSequenceandSeries/factorial2.pg?revision=101&view=markup&sortby=author&pathrev=146", "fetch_time": 1369312209000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2013-20/segments/1368703306113/warc/CC-MAIN-20130516112146-00049-ip-10-60-113-184.ec2.internal.warc.gz", "warc_record_offset": 291664330, "warc_record_length": 3039, "token_count": 601, "char_count": 1892, "score": 3.609375, "int_score": 4, "crawl": "CC-MAIN-2013-20", "snapshot_type": "latest", "language": "en", "language_score": 0.5916638970375061, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00008-of-00064.parquet"}