Design and Analysis of Algorithms

Stanford University, Winter 2024

Instructors: Nima Anari and Moses Charikar

Time: Mon & Wed 10:30 am - 12:00 pm

Location: Skilling Auditorium

Course Description: This course will cover the basic approaches and mindsets for analyzing and designing algorithms and data structures. Topics include the following: Worst and average case analysis. Recurrences and asymptotics. Efficient algorithms for sorting, searching, and selection. Data structures: binary search trees, heaps, hash tables. Algorithm design techniques: divide-and-conquer, dynamic programming, greedy algorithms, amortized analysis, and randomization. Algorithms for fundamental graph problems: minimum-cost spanning tree, connected components, topological sort, and shortest paths. Possible additional topics: network flow and string searching.

Prerequisites: CS 106B or CS 106X; CS 103 or CS 103B; CS 109 or STATS 116.

Course Grade: The course grade will be based on the following components.

Staff Contact

Bot waving with a heart

CS 161 Spring 2024

Pre-semester announcements.

Our first lecture is Wednesday, January 17, 6:30–8:00pm in Dwinelle 155. You can also livestream the lecture over Zoom. The link is posted on Ed .

Skip to current week

In addition to your collaborative work on labs for this course, you will also need to complete individual homework assignments. These assignments will build on the concepts you read about and practice during in-class labs. Assignments may use concepts that have not been discussed by the time the homework is released, so you may need to revisit the later parts of some assignments closer to the deadline.

Please review the course syllabus for policies and grading information. If you have questions about a policy you are welcome to ask about them individually or in class.

  • Assigned January 24, 2024
  • Due January 26, 2024 11:59pm
  • Assigned January 31, 2024
  • Due February 5, 2024 11:59pm
  • Assigned February 7, 2024
  • Due February 12, 2024 11:59pm
  • Assigned February 14, 2024
  • Due February 19, 2024 11:59pm
  • Assigned February 28, 2024
  • Due March 4, 2024 11:59pm
  • Assigned March 13, 2024
  • Due April 1, 2024 11:59pm
  • Assigned April 17, 2024
  • Due April 22, 2024 11:59pm
  • Assigned April 24, 2024
  • Due May 1, 2024 11:59pm
  • Assigned May 1, 2024
  • Due May 6, 2024 11:59pm

Copyright © Charlie Curtsinger, Priscilla Jimenez, and Dawn Nye

Creative Commons License

This website was built using Jekyll , Twitter Bootstrap , and the Bootswatch Cosmo Theme .

Assignments are posted in reverse chronological order and appear well in advance of their due date.

  • Show each step of your work and fully simplify each expression.
  • Turn in your answers in class on a physical piece of paper.
  • Staple multiple sheets together.
  • Feel free to use Desmos for graphing.

Answer the following:

  • In the expression \[-42(x^2 + 3)(x+3)^2 + 5(x+4)^4(x-3)^2\] in what context is the expression $(x^2 + 3)$ not considered a factor, even though it is visually next to a multiplication?
  • In fraction property #5, which says \[\dfrac{ac}{bc} = \dfrac{a}{b}\] what does $c$ need to be in order to be cancelled out?
  • Can I cross out the $x^2$ in \[\dfrac{x^2 + 1}{x^2 + 2}\] to get $\dfrac{1}{2}$? Give the reason why or why not.
  • Can I cross out the $x - 1$ in \[\dfrac{(x-1)(x+2)}{(x-1)(x+3)}\] to get $\dfrac{x+2}{x+3}$? Give the reason why or why not.
  • Can I cross out the $x - 1$ and $x + 3$ in \[\dfrac{(x-1)(x+2) + 4(x+3)}{(x-1)(x+3)}\] to get $\dfrac{x+2 + 4}{1}$? Give the reason why or why not.
  • Your friend tries to simplify $(x + 3)(x + 2)$ by using the Distributive law: \[(x + 3)(x + 2) = x + 3 \cdot x + x + 3 \cdot 2\] What did they do incorrectly?
  • How many factors is $2x$ comprised of?
  • In the global context, is the expression \[2x + 3y^2\] comprised of terms or factors?
  • In the global context, is the expression \[-x(x-2)(x+3)5\] comprised of terms or factors?
  • Global context of numerator comprises of three terms
  • Global context of denominator comprises of two terms
  • Each term in the numerator contains two factors
  • Each term in the denominator contains three factors
  • $(-\infty, 1) \cup (1, 2) \cup (2, \infty)$
  • $(-\infty, -6]\cup (2, 10)$
  • $(-10, -4]\cup (4, \infty)$
  • A student tries to simplify \[\dfrac{x^{-1} + y^{-1}}{4} = \dfrac{1}{4xy}\] Why are you not allowed to do this?
  • A student tries to simplify \[\dfrac{x+3}{x + 2} \cdot 4 = \dfrac{x+3\cdot 4}{x+2} = \dfrac{x+12}{x+2}\] Which mathematical property was violated? Hint: parentheses were forgotten.
  • $x^4 \cdot x^7$
  • $\left(\dfrac{1}{2}\right)^{-1}$
  • $\left[\dfrac{(x^3y^5)^4}{z^{-4}}\right]^0$
  • $\left(\dfrac{x}{y}\right)^2 \cdot \left(\dfrac{y^2}{z}\right)^3$
  • $\dfrac{xy^{-3}z}{(2x)^{-1}y^2z^{-2}}$
  • $\dfrac{(x+1)(x+2)}{(x+1)^{-2}(x+2)^2(x+3)}$
  • $\dfrac{\sqrt[3]{x^2}}{x^{2/3}}$
  • $\dfrac{(-3)^4\sqrt{x}}{3^2\sqrt[3]{x}}$
  • $(2x-1)^{\frac{2}{3}}(2x-1)^{-\frac{1}{3}}$
  • $(-3x)^2(-4x(x-1))^2$
  • $\left(\dfrac{x^8y^{-2}}{(x-1)(x+2)^2}\right)^{-1/2}$
  • A student tries to simplify $x^2 + x^3$ by applying exponent laws. They write \[x^2 + x^3 = x^{2+3} = x^5\] Why is this incorrect?
  • A student tries to simplify $x^2 \cdot x^3$ by applying exponent laws. They write \[x^2 \cdot x^3 = x^{2\cdot3} = x^6\] Why is this incorrect?
  • A student tries to simplify $(a + b)^2$ by applying exponent laws. They write \[(a + b)^2 = a^2 + b^2\] Why is this incorrect?
  • A student tries to simplify $(2x + \sqrt{x})^2$ by applying exponent laws. They write \[(2x + \sqrt{x})^2 = 2x + x\] State the two errors they made and why they are incorrect.
  • True or false: Like terms are expressions which share the same factors, except possibly for the coefficient (the number).
  • $3x^2$ and $4y$
  • $3x^2$ and $4x$
  • $x^3y$ and $4x^3y$
  • $5(x+1)(x+2)$ and $-(x+1)(x+2)$
  • $-100(3x-2)(4x^2+3)^2$ and $4(4x^2+3)^2(3x-2)$
  • $(2x^2 + 3x) + (3x^3 + 2x)$
  • $(x+1)(x-2)$
  • $(x^2 + 2x + 1)(x-2)$
  • $(1 - x)^2$
  • $(x^6 - x^5) -2(x^4 - x^3) - x(x^2 - x)$
  • $3(x+h)^2 - 1 - (3x^2 - 1)$
  • $-2x^3 - x^2$
  • $(x+3)^2(x-2) + (x+3)(x-2)^2$
  • $x^2 + 5x + 6$
  • $x^2 + 13x + 12$
  • $2x^2 + 7x + 3$
  • $2x^2(x-1) + 7x(x-1) + 3(x-1)$
  • $4a^2 - 9b^2$
  • $(x^2 + 1)^2 - 7(x^2 + 1) + 10$
  • $x^3 + 4x^2 + x + 4$
  • Suppose there is a variable $x$ which is associated with a value $f(x)$. I find that two different inputs give the same evaluation. In particular, I find $x = -2$ and $x = 2$ have $f(-2) = f(2)$. Is $f(x)$ a function?
  • Suppose I have an expression $f(x)$ and I find one input which gives two different evaluations. In particular, I find that $x = 2$ spits out $f(2) = 5$ and $f(2) = 3$. Is $f$ a function?
  • Suppose there is an expression \[f(x) = \dfrac{(a + h)(b+h) + x}{(a+h)^3 - 5}\] Am I allowed to cancel out the $a+h$'s to get \[\dfrac{x}{(a+h)^2 - 5}\] If I am not, when am I allowed to cancel in this fashion?
  • $x + \dfrac{3}{x}$
  • $\dfrac{x+2}{x+1} + \dfrac{1}{x+3}$
  • $\dfrac{1}{\sqrt{x}} + \dfrac{1}{\sqrt{x + h}}$
  • $\sqrt{x+2} - \dfrac{1}{\sqrt{x+2}}$
  • $\dfrac{x + 1}{\frac{x + 2}{x + 3}}$
  • $x^{\frac{2}{3}}\cdot x^3$
  • $(x+1)^8(x+1)^5$
  • $\dfrac{x(x + 3)^2 + x(x-1)}{x}$
  • $(x^2 + 3x^6)^{3/4}(x^2 + 3x^6)^{\frac{1}{2}}$
  • $(4x+3)^{-2}(x+1)$
  • When finding the domain of a function, what are the two types of inputs we need to exclude?
  • Find $f(1), f(-a), f(x+h), f(x + h) - f(x)$ and fully expand each expression.
  • Suppose a function takes an input $x$ and sends this to $\frac{1}{x + 1}$. What is the domain of $f(x)$?
  • Draw a coordinate plane and graph the functions $f(x) = x^2, g(x) = x^4$ and $h(x) = x^6$. What is similar between the graphs?
  • Graph the function \[f(x) = \begin{cases}-x^2 & x \leq 3 \\ -x + 1 & x > 3\end{cases}\]
  • Is the point $\left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right)$ on the unit circle? Show using calculations.
  • What is the reference number $\bar{t}$? What is the range of values $\bar{t}$ is allowed to be?
  • $t = \frac{3\pi}{2}$
  • $t = \frac{2\pi}{3}$
  • $t = \frac{5\pi}{6}$
  • $t = -\frac{2\pi}{3}$
  • $t = -\frac{9\pi}{4}$
  • $t = 1000\pi + \frac{2\pi}{3}$
  • $t = -83\pi + \frac{\pi}{3}$
  • $t = \pi + 2\pi - 3\pi + \frac{4\pi}{3}$
  • (skip) Find the six trigonometric functions of $t = \frac{2\pi}{3}$.
  • (skip) Find the six trigonometric functions of $t = -\frac{5\pi}{6}$.
  • Why is $\tan\left(\frac{\pi}{2}\right)$ undefined?

CS 161: Design and Analysis of Algorithms (Winter 2017)

[ Course Schedule | Midterm and Final | Homework Assignments | Recitations | Resources ]

Instructor: Gregory Valiant (email: gvaliant at cs)

Location and time: Monday and Wednesday 3:00 PM - 4:20 PM, NVIDIA Auditorium

Important! Sign up on Piazza for discussions and announcements. We strongly encourage discussion and asking questions on Piazza. Questions to the course staff (that are not addressed to a specific person) can be sent using a private post in Piazza.

Course Description This course will cover the basic approaches and mindsets for analyzing and designing algorithms and data structures. Topics include the following: Worst and average case analysis. Recurrences and asymptotics. Efficient algorithms for sorting, searching, and selection. Data structures: binary search trees, heaps, hash tables. Algorithm design techniques: divide-and-conquer, dynamic programming, greedy algorithms, amortized analysis, randomization. Algorithms for fundamental graph problems: minimum-cost spanning tree, connected components, topological sort, and shortest paths. Possible additional topics: network flow, string searching.

Prerequisites: CS 103 or CS 103B; CS 109 or STATS 116.

Requirements: 7 homework assignments (35%), a midterm (25%), and a final exam (40%).

Course Schedule and Lecture Notes

Topics and readings for future lectures are tentative and may be changed as the course proceeds. The readings refer to the 3rd edition of CLRS (see Resources below), but older editions should be fine as well.

Midterm and Final

Midterm: Wednesday, February 22, in class, 3:00 pm - 4:20 pm Final: Monday, March 20, 3:30-6:30pm.

Both the midterm and final are closed-book. In the midterm, you are allowed to bring one letter-sized double-sided page of notes. In the final, you are allowed to bring two letter-sized double-sided page of notes.

Practice Midterm Solutions to the Practice Midterm

Midterm Midterm Solutions

Final Exam Final Exam Solutions

Finals from Previous Years

The following final exams are taken from previous offerings of the class. They are posted here as a resource, but the material covered in them may differ what the material covered this quarter, and their structure may differ from this quarter's final exam.

Winter 2009 Winter 2011 Practice Final Spring 2016 Solutions to Spring 2016

Homework Assignments

  • Homework 2 (released 1/20, due 1/27 at 3pm). [ pdf ] [ raw LaTex file ] Solutions
  • Homework 2 (released 10/7, due 10/14 at 3pm) Assignment Solutions
  • Homework 3 (released 10/14, due 10/21 at 3pm) Assignment Solutions
  • Homework 4 (released 10/21, due 10/28 at 3pm) Assignment Solutions
  • Homework 5 (released 11/4, submission deadline extended - see Piazza) Assignment Solutions
  • Homework 6 (released 11/12, due 11/19 at 11:59pm, late submission until 11/21 at 11:59pm) Assignment Solutions
  • Homework 7 (released 11/19, due 12/2 at 3pm) Assignment Solutions

Submission Instructions and Policies

  • All assignments are posted on Fridays, and are due the next Friday at 3pm.
  • All assignments must be submitted electronically as a PDF file using Gradescope (access code: 9R2NW9).
  • All assignments should be typed using LaTeX, LyX, Microsoft Word, or a similar editor. For first time LaTeX users, see the resources section. Scanned handwritten assignments are not accepted.
  • Each student is allowed to discuss the assignment (verbally) with at most two other students. Each student should write (in your own words) and submit your own solution. When you submit the assignment, you should indicate with whom you have discussed the solutions.
  • You are allowed to use textbooks, resources that are listed on this page, and other reading material that you find on the Internet. If you use results from the textbooks or resources listed on this page, make sure to cite the results you are using properly. If you are using other resources, you have to prove any statement that you use (and still, make sure to cite the source properly).
  • You are not allowed to look for the answers for any of the homework assignments (online or otherwise). If you accidentally find a solution for a question, do not read it (if it is not too late), and indicate that clearly on your assignment (including where you found the solution).
  • Please follow the honor code .
  • Each student has two late submission passes. Each pass allows the student to submit an assignment on Sunday at 3pm (instead of Friday). Late submission passes cannot be split between assignments or used twice for the same assignment. Please note that late assignments may need to be submitted as a separate assignment in Gradescope (as the submission of the original assignment may be closed).
  • For each assignment, regrade requests will open on Gradescope on Wednesday (after the grades have been published) and close on Sunday.
  • Please provide a detailed explanation for your regrade request.
  • Note that we may regrade any part of the assignment, and the new grade may be greater than, equal to, or less than the original grade.

Recitations

We hold recitation sections in order to review some of the material and solve additional exercises with the students in smaller groups. The sections are optional but highly recommended. The schedule (including locations) of the recitation sections appears in the office hours calendar. Each section covers the material of the previous week except for Friday sections that cover the material of the same week.

  • Recitation 1 (week 1) Solutions
  • Recitation 2 (10/7-10/12) Solutions
  • Recitation 3 (10/14-10/19) Solutions
  • Recitation 4 (10/21-10/26) Solutions
  • Recitation 5 (11/4-11/9) Solutions
  • Recitation 6 (11/11-11/16) Solutions
  • Recitation 7 (11/18-11/30) Solutions
  • Recitation 8 (12/2-12/7) Solutions

The main textbook we use is: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein, Introduction to Algorithms , 3rd Edition, MIT Press The book is available online through the Stanford library.

We will also occasionally use: Jon Kleinberg, Éva Tardos, Algorithm Design , Pearson/Addison-Wesley Sanjoy Dasgupta, Christos Papadimitriou, Umesh Vazirani, Algorithms , McGraw-Hill Education

LaTeX Resources

We strongly recommend typesetting solutions to the homework assignments using LaTeX. LaTeX provides a convenient way to produce high-quality documents and it is the standard used for typesetting computer science papers.

Guide: An introduction to LaTeX can be found here . Other guides can be found at howtoTeX and Wikibooks .

Online environments: If you do not wish to install LaTeX, ShareLaTeX and Overleaf are online environments that compile previews of your documents as you type and allow you to share documents with collaborators (this feature won't be useful in this course, though). As a Stanford student, you get a free Overleaf Pro account.

LyX: LyX is a version of LaTeX with graphical interface.

Finding mathematical symbols: The introduction mentioned above contains a table of mathematical symbols in LaTeX. Alternatively, consider Detexify .

Examples: homework1.tex homework2.tex homework3.tex homework4.tex homework5.tex homework6.tex homework7.tex -->

IMAGES

  1. cs161 Homework 5.pdf

    homework 161

  2. Week 14

    homework 161

  3. Pokémon Homework 161 161

    homework 161

  4. change the sentences according to the mode Homework 161 T6

    homework 161

  5. homework 3AMS 161.pdf

    homework 161

  6. sign 161 homework

    homework 161

VIDEO

  1. #LAPS2R2Challenge was an even more challenging drill to end CCW Training

  2. It's Just Medicine l Aria and Ezra (Ezria) pretty little liars 5x01

  3. 15 Minute Timer

  4. Simple Sausage Rolls #shorts

  5. 🎃Halloween subliminal🎃

  6. need homework for day 2 stream

COMMENTS

  1. Homework

    General Homework Information. Homeworks 1-3 will be individual submissions, which means that students should type up their own homework. From Homework 4 onwards, paired submissions are permitted, so students can make a single submission for groups of size up to 2.

  2. Homework

    General Homework Information. Homework solutions should be typed and submitted on Gradescope. Important Collaboration Policy and Honor Code rules apply to all homework. You have a limited number of late days. See Late Day Policy for details. Homework

  3. CS 161

    Course Description: This course will cover the basic approaches and mindsets for analyzing and designing algorithms and data structures. Topics include the following: Worst and average case analysis. Recurrences and asymptotics. Efficient algorithms for sorting, searching, and selection. Data structures: binary search trees, heaps, hash tables.

  4. CS 161: Design and Analysis of Algorithms, Spring 2017

    Course Description This course will cover the basic approaches and mindsets for analyzing and designing algorithms and data structures. Topics include the following: Worst and average case analysis. Recurrences and asymptotics. Efficient algorithms for sorting, searching, and selection. Data structures: binary search trees, heaps, hash tables.

  5. PDF CS161 Winter 2017 Problem Set Advice

    a pair that sums to k; namely, it's (A[left], A[right]). If the algorithm returns false, it must be the case that left = right. By (*), we know that in this case, if there is a solution, it must satisfy left ≤ i < j ≤ right = left, which is impossible. Thus no solution exists.

  6. PDF CS 161: Homework 1

    CS 161: Homework 1 Submit via Gradescope by 3pm (PST), Janurary 20, 2017. Instructions: Please answer the following questions to the best of your ability. Unless otherwise indicated, provide full and rigorous proofs and include all relevant calculations. When writing proofs, please strive for clarity and brevity (in that order).

  7. PDF CS161(Stanford,Winter2024) Homework5

    CS161(Stanford,Winter2024) Homework5 Styleguideandexpectations: Pleaseseethe"Homework" partofthe"Resources" sec ...

  8. CS 161

    Homework is to be handed in via GradeScope.; Please adhere to the collaboration policies.In brief: You must complete the ``Exercises" section on your own.; You may collaborate on the ``Problems" section, but (a) you must give credit to those you worked with, and (b) you must type up your own solutions from scratch.. Homework solutions must be typed, and submitted as a PDF.

  9. PDF CS 161: Homework 2

    CS 161: Homework 2 Submit via Gradescope by 3pm (PST), January 27, 2017. Instructions: Please answer the following questions to the best of your ability. Unless otherwise indicated, provide full and rigorous proofs and include all relevant calculations. When writing proofs, please strive for clarity and brevity (in that order).

  10. CS 161: Computer Security

    Prerequisites: The prerequisites for CS 161 are CS 61B, CS61C, and either CS70 or Math 55. We assume basic knowledge of both Java and C. You will need to have a basic familiarity using Unix systems. Collaboration: Homework assignments will specify whether they must be done on your own or may be done in groups.

  11. CS 161: Design and Analysis of Algorithms, Fall 2016

    CS 161: Design and Analysis of Algorithms (Fall 2016) [ Course Schedule | Midterm and Final | Homework Assignments | Recitations | Resources] Instructor: Moses Charikar (email: moses at cs) Location and time: Monday and Wednesday 1:30 PM - 2:50 PM, CEMEX Auditorium Important! Sign up on Piazza for discussions and announcements. We strongly encourage discussion and asking questions on Piazza.

  12. CSC 161

    Homework 8: Paranoia Game Assigned. April 24, 2024 Due. May 1, 2024 11:59pm In this homework, you will write a program that uses linked lists to keep track of players in a game of Paranoia.Paranoia (also known by a variety of other names such as Assassin) is a popular "real-life" game where every player is assigned a unique target that only they know about.

  13. Homework

    CS 161 (Archived) Schedule; Lectures; EthiCS Lectures; Sections; Homework; Exams; Resources; Policies; Staff / Office Hours

  14. PDF Homework 2 Solutions

    Homework 2 Solutions. CS161 Computer Security, Spring 2008. 1. Signatures and Attacks Recall that to use the ElGamal signature scheme, Alice randomly se- lects her private signing key x2Z. pand computes her public veri cation key as y= gxmod p, where pis a large prime and gis a publicly known generator of Z. p. To sign a message m2Z.

  15. CS 161 Spring 2024

    CS 161 Spring 2024 Calendar Skip to current week. Wk. Date Lecture Discussion HW Project; 1: Wed Jan 17: 1. Introduction and Security Principles Slides / Recording / Ch. 1: 0. 61C Review Worksheet / Solutions / Video: HW1 (due Friday 01/26) 2: Mon Jan 22: 2. x86 Assembly and Call Stack ...

  16. CS 161

    Collaboration between groups (of enrolled CS161 students) is allowed, but (a) you must give credit to collaborators, and (b) each group must type up their own solutions from scratch. No collaboration outside of CS161 is allowed. Homework solutions must be typed, and submitted as a PDF. See the Resources section for help on typesetting ...

  17. CSC 161

    Homework. In addition to your collaborative work on labs for this course, you will also need to complete individual homework assignments. These assignments will build on the concepts you read about and practice during in-class labs. Assignments may use concepts that have not been discussed by the time the homework is released, so you may need ...

  18. CSC 161 : Homework

    Homework Assignments CSC 161: Imperative Problem Solving: Fall 2021 Assignments are posted in reverse chronological order and appear well in advance of their due date. Assignment Due; Homework 5: Maze Solving: Sun 12/05: Homework 4: 2D Image Convolution:

  19. Homework 1 (PHYS 161)

    Wednesday, September 8, 2021 11:18 PM. Montgomery College Physics 161: Homework 1 - Professor Hosseini homework wednesday, september 2021 11:18pm during 100 sprint, the runner starts from rest and.

  20. Math 161

    Math 161 - Homework 1. Homework 1. Directions: Show each step of your work and fully simplify each expression. Turn in your answers in class on a physical piece of paper. Staple multiple sheets together. Feel free to use Desmos for graphing. Answer the following: In the expression \ [-42 (x^2 + 3) (x+3)^2 + 5 (x+4)^4 (x-3)^2\] in what context ...

  21. PDF CS 161 1. f n O g n f n g n f n g n c n f n g n c ...

    CS 161 Problem Set 2 Summer 2017 Due: July 14, 2017, 11:59 p.m. 1. Asymptotics redux (5 points) For the following pairs of functions f(n) and g(n), indi-

  22. CS 161: Design and Analysis of Algorithms, Winter 2017

    Course Description This course will cover the basic approaches and mindsets for analyzing and designing algorithms and data structures. Topics include the following: Worst and average case analysis. Recurrences and asymptotics. Efficient algorithms for sorting, searching, and selection. Data structures: binary search trees, heaps, hash tables.

  23. Physics 161

    The rest of the problems assigned on the homework will be graded out of 2 points each. An correct solution gets 2 points, a valiant attempt "almost there" gets 1.5 points, while a good attempt (right method with the correct equations, correct picture) could get 1 point, some attempt gets 0.5 points. 1 point (out of 2) will be taken off for lack ...

  24. Avoidance Predicts Worse Long-term Outcomes in OCD

    The new study analyzed data from 161 Norwegian adults with treatment-resistant OCD who participated in a concentrated ERP therapy called the Bergen 4-day Exposure and Response Prevention (B4DT ...