Sponsored Ad:
Results 1 to 2 of 2

Thread: 3 digit number

  1. #1
    Within my grasp! computer-bot's Avatar
    Join Date
    Dec 2006
    Location
    Pakistan
    Posts
    438
    Rep Power
    14


    Good post? Yes | No

    3 digit number

    Sponsored Ad:
    How many 3 digit numbers can we make such that two of the digits are same and non of the digits equal zero?

  2. #2
    Trying to make mom and pop proud
    Join Date
    Feb 2019
    Posts
    10
    Rep Power
    1


    Good post? Yes | No

    Re: 3 digit number

    0 _ _

    For a three digit number, hundreds digit can have only 9 possible values (1-9) because if hundreds digit is zero then the number is not a 3 digit number.

    Case I. Hundreds digit and units digit are same
    9 possible values for hundreds digit, the same number has to be at units place. Except the number at hundreds place and zero, tens digit can have 8 possible values. Possible number of permutations = 9*8*1 = 72

    Case II. Hundreds digit and tens digit are same
    9 possible values for hundreds digit, the same number has to be at tens place. Except the number at hundreds place and zero, units digit can have 8 possible values. Possible number of permutations = 9*1*8 = 72

    Case III. Units digit and Tens digit are same
    9 possible values for hundreds digit. Since the number at tens (or units) place is different than the number at hundreds digit (otherwise all three numbers will be equal) and since we can't include zero, tens (or units) place will also have 8 possible values for this case. Possible number of permutations will be = 9*8*1 = 72

    Adding all the possible permutations we'll get 216 possible numbers.


    ------ --------- ----------- ---------- --------- -------

    I also write the following python code for this problem - it returns 216 elements.


    result_numbers = []
    counter_=0
    for n in range(100, 1000):
    ns = list(str(n))
    if '0' not in ns:
    if ns[0]==ns[1] or ns[1]==ns[2] or ns[0]==ns[2]:
    if ns[0]==ns[1] and ns[1]==ns[2]:
    counter_ +=0
    else:
    counter_ +=1
    result_numbers.append(n)
    print ("counter={}".format(counter_))
    print (result_numbers)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 06-12-2013, 06:07 AM
  2. Replies: 1
    Last Post: 11-22-2011, 07:28 PM
  3. How to find the tens digit of a 3 digit number ?
    By whizteen123 in forum GMAT Data Sufficiency
    Replies: 3
    Last Post: 02-28-2006, 07:00 PM
  4. Replies: 1
    Last Post: 11-21-2004, 01:39 AM
  5. Replies: 1
    Last Post: 08-21-2004, 06:13 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •