Skip to content

平成24年度 秋期 ITパスポート試験 問66

This question's explanation and your answers so far.

問66
頻出度★★☆

2進数に変換したとき,有限小数で表現できる10進数はどれか。

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

問 66

  • Incorrectア

    In lowest terms 0.1 is 1/10 = 1/(2×5), and the prime factor 5, which is not 2, remains in the denominator, so it is not a finite fraction in binary. Converting with the repeated-doubling method: 0.1×2=0.2 (integer part 0), 0.2×2=0.4 (0), 0.4×2=0.8 (0), 0.8×2=1.6 (1), 0.6×2=1.2 (1), and the fractional part returns to 0.2, after which the same calculation repeats, giving 0.0001100110011..., a repeating fraction in which 0011 continues endlessly. Incidentally, this very property is the reason a computer cannot represent the decimal 0.1 exactly as a binary floating-point number and produces an error.

  • Incorrectイ

    In lowest terms 0.2 is 1/5, and its denominator is 5 rather than a power of 2, so it is not a finite fraction in binary. With the repeated-doubling method: 0.2×2=0.4 (integer part 0), 0.4×2=0.8 (0), 0.8×2=1.6 (1), 0.6×2=1.2 (1), and at that point the fractional part returns to the original 0.2, giving 0.001100110011..., an infinite fraction in which 0011 repeats. Note that even a number that looks “neat” in decimal because it ends at the first digit after the decimal point is not necessarily representable with a finite number of digits once the radix changes to 2.

  • Incorrectウ

    In lowest terms 0.4 is 2/5, and the factor 5 remains in the denominator, so it is not a finite fraction in binary. With the repeated-doubling method: 0.4×2=0.8 (integer part 0), 0.8×2=1.6 (1), 0.6×2=1.2 (1), 0.2×2=0.4 (0), and the fractional part returns to the original 0.4, so it repeats as 0.011001100110.... You may also reason that 0.4 is twice 0.2, that is, in binary it is simply the digit pattern of 0.2 shifted one place to the left, so as long as 0.2 repeats, 0.4 must repeat as well.

  • エ

    正解 The correct answer is エ, 0.5. Whether a decimal fraction becomes a finite (terminating) fraction in binary — one that ends after a limited number of digits — is decided by the denominator obtained when the value is written as a fraction in lowest terms. The n-th digit after the binary point represents 2 to the power of -n (0.1 is 1/2, 0.01 is 1/4, 0.001 is 1/8, and so on), so any number that can be written with a finite number of digits must have the form “an integer divided by 2 to the power of n”. Put the other way round, only when the denominator of the fraction in lowest terms is a power of 2 (2, 4, 8, 16, ...) does the number terminate in binary; if a prime factor other than 2, such as 5, remains in the denominator, it always becomes a repeating fraction. In lowest terms 0.5 is 1/2, and its denominator is exactly 2 to the power of 1, so in binary it can be written as 0.1 with just one digit, and that is a terminating fraction. Checking with the actual conversion procedure (the repeated-doubling method: multiply the fractional part by 2 and write out the integer part digit by digit from the top) gives the same result: 0.5×2=1.0 puts a 1 in the integer part, and the fractional part becomes 0 at that point, so the calculation ends. Therefore, among the choices, the decimal number that can be represented as a finite fraction when converted to binary is エ.

ここがポイント
  • The condition for a finite fraction in binary — when a decimal fraction is written in lowest terms, only those whose denominator is a power of 2 (2, 4, 8, 16, ...) become finite fractions in binary. Values such as 0.1, 0.2, 0.3, and 0.4, which keep a prime factor other than 2 (such as 5) in the denominator, all become repeating fractions in binary, and only values that can be written as a sum of powers of 1/2, such as 0.5, 0.25, 0.75, and 0.125, can be expressed with a finite number of digits.
  • Radix conversion from a decimal fraction to a binary fraction (the repeated-doubling method) — multiply the fractional part by 2, write out its integer part (0 or 1) digit by digit starting from the first place after the binary point, and repeat the same operation on the remaining fractional part. If the fractional part becomes 0, the conversion is complete as a finite fraction; if the same fractional part appears again, everything from there on is a repeating fraction. It is also worth remembering that this kind of error is the cause of rounding errors in floating-point arithmetic.
用語

Your answers