benchmarks.wiki / Public workspace

MMLU-Pro / 10478 / The procedure below is intended to display the index in a list of unique names…

Problem

Answer published by the source. Consult the official source to check your work against its answer.

question

The procedure below is intended to display the index in a list of unique names (nameList) where a particular name (targetName) is found. lf targetName is not found in nameList, the code should display 0.
 PROCEDURE FindName (nameList, targetName)
 {
  index ← 0
  FOR EACH name IN nameList
  {
   index ← index + 1
   IF (name = targetName)
   {
   foundIndex ← index
   }
   ELSE
   {
   foundIndex ← 0
   }
  }
  DISPLAY (foundIndex)
 }
 Which of the following procedure calls can be used to demonstrate that the procedure does NOT Work as intended?

category

computer science

options

  1. FindName (["Andrea", "Ben", "Chris", "Diane", "Eva", "Frank", "Grace", "Hannah", "Igor"], "Igor" )
  2. FindName (["Andrea", "Ben", "Chris", "Diane"], "Diane" )
  3. FindName (["Andrea", "Ben", "Chris", "Diane", "Eva", "Frank"], "Frank" )
  4. FindName (["Andrea", "Ben"], "Ben" )
  5. FindName (["Andrea", "Chris", "Diane"], "Ben")
  6. FindName (["Andrea", "Ben" ], "Diane" )
  7. FindName (["Andrea", "Ben", "Chris"], "Ben")
  8. FindName (["Andrea", "Ben", "Chris", "Diane", "Eva"], "Eva" )
  9. FindName (["Andrea", "Ben", "Chris", "Diane", "Eva", "Frank", "Grace", "Hannah"], "Hannah" )
  10. FindName (["Andrea", "Ben", "Chris", "Diane", "Eva", "Frank", "Grace"], "Grace" )

src

ori_mmlu-high_school_computer_science

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import