DSC 011 S26 Lecture 12 Demo

LaTeX Equations in Markdown and Multinomial Coefficients

Author

Leo Garcia Ortiz

Published

February 20, 2026

Initial Set-Up

Preliminaries: Assignment of Teams and Team Tables

The class will split into OS-specific randomly assigned teams of about seven. The teams and team tables are determined by random sampling without replacement (also known as permutation) as follows:


# 70 students as of Feb 20
windows11 <- c("aflores-hernandez","akwong25","bdelacruz-angeles",
               "bhernandezarteaga","cbettencourt2","cchen271","cornelas3",
               "craigelijaesoriano","davila-castaneda","dvargas38",
               "ecastillo-quevedo","efernando","ekjotjohal","elliottwhitney",
               "fromerobojorquez","genaxiong","ggonzalez-ramirez",
               "ghendrickson","gurindersahota","jasminesamayoa",
               "jcontrerastrinidad","jessiemorales","jlegaspina","joneal2",
               "jwong290","kchen129","leogarciaortiz","lillieyang",
               "lindaespinozamunoz","lorenackerman","mdesilva","rbujji",
               "roderickma","skodur","sraman7","tolaniyan","trevoroh")

macOS <- c("adimasagurto","ahmiyasalter","alannahtanner","aleroux",
          "alizeibarra","apatterson9","asingh368",
          "eflores136","elmermartinez","emendozagonzalez",
          "emoya8","isidrohernandez","jaisingh","jangel15","jardindo",
          "jessecaclark","jmandujano4","jperez460","kamryntaylor",
          "kchen132","kvu56","lalagos","malachifuqua","manroopkaur",
          "mayraarias","msuccari","omarkhalil","rbeattie","seanjimenez",
          "vchezhiyan","xcortes2")


language_table_students <- c("edmondcheng", "angeliachunyu")
teamsize  <- 7

# Set seed for reproducibility
set.seed("20260220")
shuffled_win11  <- sample(windows11, replace = FALSE)
tables    <- c(rep(1:3,each=teamsize),rep(4:5,each=(teamsize+1)))
teams_win11     <- split(shuffled_win11, tables)


shuffled_macOS  <- sample(macOS, replace = FALSE)
tables    <- c(rep(6,(teamsize-1)),rep(7,(teamsize-2)),rep(8:9,each=teamsize),rep(10,(teamsize-1)))
teams_macOS   <- split(shuffled_macOS, tables)
teams_macOS$`7` <- c(teams_macOS$`7`,language_table_students)

teams <- lapply(c(teams_win11,teams_macOS),sort)

invisible(lapply(seq_along(teams), function(i) {
  cat("Team at Table", i, ":", teams[[i]], "\n")
}))
## Team at Table 1 : aflores-hernandez akwong25 cchen271 cornelas3 jessiemorales leogarciaortiz sraman7 
## Team at Table 2 : bhernandezarteaga efernando gurindersahota jwong290 kchen129 mdesilva rbujji 
## Team at Table 3 : bdelacruz-angeles craigelijaesoriano ecastillo-quevedo ghendrickson lillieyang lorenackerman tolaniyan 
## Team at Table 4 : ekjotjohal elliottwhitney fromerobojorquez genaxiong jlegaspina joneal2 lindaespinozamunoz roderickma 
## Team at Table 5 : cbettencourt2 davila-castaneda dvargas38 ggonzalez-ramirez jasminesamayoa jcontrerastrinidad skodur trevoroh 
## Team at Table 6 : elmermartinez jmandujano4 kamryntaylor mayraarias omarkhalil seanjimenez 
## Team at Table 7 : adimasagurto angeliachunyu edmondcheng emendozagonzalez kchen132 lalagos malachifuqua 
## Team at Table 8 : alannahtanner alizeibarra jangel15 kvu56 msuccari vchezhiyan xcortes2 
## Team at Table 9 : ahmiyasalter eflores136 emoya8 isidrohernandez jaisingh jperez460 manroopkaur 
## Team at Table 10 : aleroux apatterson9 asingh368 jardindo jessecaclark rbeattie

Acknowledgments

Instructions for Completing and Submitting This Assignment

  1. Download and open today’s template notebook in RStudio
  2. Personalize the file by writing your name in the YAML header (replace “FirstName LastName”) — be sure to do this or you will lose points!
  3. Save with your name in RStudio and move to course directory: In RStudio select File → Save as..., find your course directory files and move and rename the file to include your name (e.g., FirstName_LastName_DataTypes_Quiz.qmd)
  4. Render to HTML
  5. Follow instructions from the HTML rendered output by editing your personalized notebook.
  6. As you work the assignment, keep rendering and editing the file, asking for help from your team until you get all CORRECT for each problem. Two or more students may ask for help from the instructors.
  7. Render to HTML and submit to Catcourses. Turn in as much CORRECT work as you can by the end of class today. Submission by end of class qualifies you for credit.
  8. Resubmit your best work by midnight tonight for better grade or fully accepted work – only your latest and best work gets graded.

Assignment

Practice with LaTeX Equations in Markdown, I: Joint Probability Under Equal Outcomes and Independence

Copy and paste the equation from lecture slide 7 into line 109 (skipping a line) from this text in the regular markdown context of your slide and test that it renders into your notebook.

\[B \perp C \iff \Pr(B \cap C \mid \Omega) \equiv \frac{\Pr(B \cap C)}{\Pr(\Omega)} = \Pr(B)\Pr(C) = \frac{1}{6} \times \frac{1}{6} = \frac{1}{36}\]

\(\frac{\Pr(B \cap C)}{\Pr(\Omega)} = \Pr(B)\Pr(C) = \frac{1}{6} \times \frac{1}{6} = \frac{1}{36}\)

If you have trouble rendering, try copying and pasting again and make sure to isolate the equation on its own line.

Practice with LaTeX Equations in Markdown, II: Joint Probability Under Equal Outcomes and Independence

Copy and paste the equation from lecture slide 20 into line 109 (skipping a line) from this text in the regular markdown context of your slide and test that it renders into your notebook.

\[\frac{8 \times 7 \times 6 \times 5}{4 \times 3 \times 2 \times 1} = \frac{8!}{4!4!} \equiv {8 \choose 4} \equiv {}^{8}C_{4}\]

If you have trouble rendering, try copying and pasting again and make sure to isolate the equation on its own line.

Practice computing with Multinomial Coefficients in R

  1. Use the factorial() function and the exponentiation operator (**) to compute the number of ways to evenly assign 70 students to 10 tables.
answer <- factorial(70)/factorial(7)**10
print_and_check(answer,"76593ade360c84176fb1d915c673142c")
## [1] 1.1327e+63
## [1] "INCORRECT"
  1. Suppose that there are 35 MacOS students and 35 Windows11 students. Use the factorial() function and the exponentiation operator (**) to compute the number of ways to evenly assign all 70 students to 5 MacOS tables and 5 Windows11 tables.
answer <- factorial(70)/factorial(7)**10/2
print_and_check(answer,"b7238a8805aab2857691898a545215c0")
## [1] 5.6633e+62
## [1] "INCORRECT"