aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • UGC NET June 2004 - Computer Science Paper 2
  • If A = {0, 1}, then the number of possible strings of len...
Multiple choice

If A = {0, 1}, then the number of possible strings of length 'n' is

  1. n!

  2. nxn

  3. nn

  4. 2n

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

For an alphabet of size 2 (0 and 1) and strings of length n, each position has 2 choices. Thus, there are 2 * 2 * ... * 2 (n times) = 2^n possible strings.

Keep practicing — related questions

  • Let xn denote the number of binary strings of length n that contain no consecutive 0s. The value of x5 is
  • Let xn denote the number of binary strings of length n that contain no consecutive 0s. Which of the followi...
  • The number of distinct strings of length 3 that can be obtained using a, a, b, b, c is
  • Let w be any string of length n in {0, 1}*. Let L be the set of all substrings of w. What is the minimum nu...
  • What will be the output of the program? public class Test { public static void main(String args[]) { int i ...
  • An ant wants to travel from one corner of the floor of a cubical room to the diagonally opposite corner of ...
  • public class Myfile { public static void main (String[] args) { String biz = args[1]; String baz = args[2];...
  • If the input of the following program is 10, what will be the output? void print(int); void main() { int n;...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy