IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    sumdiff: Sum Minus Difference

    R/exams发表于 2025-04-28 22:00:00
    love 0
    [This article was first published on R/exams, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
    Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

    Exercise template for a very basic arithmetic task, namely computing the sum of two random numbers minus their difference.

    Name:
    sumdiff
    Type:
    num
    Related:
    deriv
    Preview:

    By how much is the sum of the numbers 52 and 30 greater than the difference between these numbers?

    The result of the calculation is (52 + 30) – (52 – 30) = 82 – 22 = 60.

    By how much is the sum of the numbers 32 and 22 greater than the difference between these numbers?

    The result of the calculation is (32 + 22) – (32 – 22) = 54 – 10 = 44.

    By how much is the sum of the numbers 42 and 31 greater than the difference between these numbers?

    The result of the calculation is (42 + 31) – (42 – 31) = 73 – 11 = 62.

    Description:
    Minimal arithmetic task (sum of two numbers minus their difference) with randomly-drawn numbers but only short text description and no mathematical notation in LaTeX.
    Solution feedback:
    Yes
    Randomization:
    Random numbers
    Mathematical notation:
    No
    Verbatim R input/output:
    No
    Images:
    No
    Other supplements:
    No
    Template:
    sumdiff.Rmd
    sumdiff.Rnw
    Raw: (1 random version)
    sumdiff.md
    sumdiff.tex
    PDF:
    sumdiff-Rmd-pdf
    sumdiff-Rnw-pdf
    HTML:
    sumdiff-Rmd-html
    sumdiff-Rnw-html

    Demo code:

    library("exams")
    
    set.seed(403)
    exams2html("sumdiff.Rmd")
    set.seed(403)
    exams2pdf("sumdiff.Rmd")
    
    set.seed(403)
    exams2html("sumdiff.Rnw")
    set.seed(403)
    exams2pdf("sumdiff.Rnw")
    To leave a comment for the author, please follow the link and comment on their blog: R/exams.

    R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
    Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
    Continue reading: sumdiff: Sum Minus Difference


沪ICP备19023445号-2号
友情链接