Skip to content

平成24年度 春期 ITパスポート試験 問69

This question's explanation and your answers so far.

問69
頻出度★★☆

札幌にある日本料理の店と函館にある日本料理の店をまとめて探したい。検索条件を表す論理式はどれか。

出典 平成24年度 春期 ITパスポート試験 問69
解説

問 69

  • Incorrectア

    (“Sapporo” AND “Hakodate”) AND “Japanese cuisine” is an expression that narrows the results down to only those restaurants containing both the word Sapporo and the word Hakodate at the same time. AND is an operation that narrows conditions (intersection), and a single restaurant is not normally located in both Sapporo and Hakodate, so the search would return almost zero hits. What you want is restaurants in either one of the two cities, so the place names must be joined with OR, not AND.

  • Incorrectイ

    In (“Sapporo” AND “Hakodate”) OR “Japanese cuisine”, the place-name condition and the “Japanese cuisine” condition are put side by side with OR, so anything that satisfies “Japanese cuisine” alone becomes a hit. As a result, Japanese restaurants in areas that have nothing to do with Sapporo or Hakodate, such as Tokyo or Osaka, are all picked up too, and narrowing by area does not work. On top of that, the first half is the same condition as in ア, requiring both Sapporo and Hakodate, so the place-name side barely functions at all.

  • ウ

    正解 What you want is the set of Japanese restaurants located in Sapporo combined with the set of Japanese restaurants located in Hakodate. Written with sets, this is (Sapporo ∩ Japanese cuisine) ∪ (Hakodate ∩ Japanese cuisine), and factoring out the common term “Japanese cuisine” gives (Sapporo ∪ Hakodate) ∩ Japanese cuisine. Rewriting that as a search expression gives choice ウ, (“Sapporo” OR “Hakodate”) AND “Japanese cuisine”. The location may be either Sapporo or Hakodate, so the place names are joined with OR; on top of that, being Japanese cuisine must always hold, so it is combined with AND. The key point is that the parentheses are placed around the place names, so OR applies only to the place names while AND applies to the whole.

  • Incorrectエ

    (“Sapporo” OR “Hakodate”) OR “Japanese cuisine” is an expression in which all three conditions are joined by OR, which amounts to “Sapporo OR Hakodate OR Japanese cuisine”. Any restaurant in Sapporo is a hit no matter what its cuisine is, so ramen shops and izakaya come up as well, and any Japanese restaurant is a hit no matter what the area is, so the whole country comes up. OR is an operation that widens conditions (union), so the condition you want to narrow by, namely being Japanese cuisine, has to be joined with AND.

ここがポイント
  • Properties of logical operations: AND (logical conjunction) narrows the conditions and leaves only the part they have in common, while OR (logical disjunction) widens the conditions and gathers everything that satisfies at least one of them. In a search expression, join the conditions that must always hold with AND, and the candidates where any one will do with OR.
  • The distributive law and the role of parentheses: (A AND C) OR (B AND C) = (A OR B) AND C. For problems of the form “find the X of A and the X of B together”, the standard approach is to factor out the common condition X with AND and group the alternatives A and B inside parentheses with OR; if the position of the parentheses changes, the search range becomes something completely different.
用語

Your answers