Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 121827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:01:56+00:00 2026-05-11T04:01:56+00:00

For all trinary numbers with length 36 (including those starting with 0’s), how many

  • 0

For all trinary numbers with length 36 (including those starting with 0’s), how many have exactly equal counts of 1’s and 2’s, or exactly one more 1 than 2?

For example:

  • 00 – yes
  • 01 – yes
  • 02 – no
  • 10 – yes
  • 11 – no
  • 12 – yes
  • 20 – no
  • 21 – yes
  • 22 – no

So for all trinary numbers of length 2, 5 out of 9 possibilities match. This presumably gets smaller as the length increases. For length 3, there are 13 out of 27.

If we were dealing with binary numbers, there are a number of solutions available here but it isn’t clear to me how to generalise these to trinary numbers.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:01:56+00:00Added an answer on May 11, 2026 at 4:01 am

    A friend of mine gave me the following answer, and he knows more math than I do. I have marked this as ‘community’ because it is not my work.

    You would need to know the number of ways for every (most?) combination, not just equal 1s/2s. EG you can put together +18 and -18 to get an equal number of 1s and 2s

    18 0/0 0/1 ... 0/18 1/0 1/1 ... 1/17 ... 18/0 

    Solving directly seems much easier.

    0/0 1/0 1/1 2/1 2/2 3/2 3/3 ... 18/17 18/18 

    Do the combinatorics

    0/0 = 1 way 1/0 = (36C1) = 36 possibilities 1/1 = (36C1) * (36-1C1) = 1260 possibilities 2/1 = (36C2) * (36-2C1) = 21420 2/2 = (36C2) * (36-2C2) = 353430 3/2 = (36C3) * (36-3C2) = 3769920 3/3 = (36C3) * (36-3C3) = 38955840 4/3 4/4 5/4 5/4  18/17 = (36C18) * (36-18C17) = 163352435400 18/18 = (36C18) * (36-18C18) = 9075135300 

    Perl script to print out lines for bc, because I’m too lazy to write code that balances the multiplications and divisions nicely.

    sub print_choose {     $n = $_[ 0 ];     $c = $_[ 1 ];      if( $c == 0 ) { print '1'; return; }      for( $j = 0; $j < $c; ++$j ) {         if( $j ) { print '*'; }         print $n - $j;     }     for( $j = 0; $j < $c; ++$j ) {         print '/', $c - $j;     } }  for( $i = 0; $i <= 18; ++$i ) {     if( $i > 0 ) {         print_choose( 36, $i );         print '*';         print_choose( 36 - $i, $i - 1 );         print '\n';     }      print_choose( 36, $i );     print '*';     print_choose( 36 - $i, $i );     print '\n'; }   foo.pl | bc | perl -ne '$sum += $_; print '$sum\n'' 1 37 1297 22717 376147 4146067 43101907 335270707 2453494507 14315547787 78370635499 355942682251 1512492877051 5477807830651 18506699821051 54336152794651 148388466850351 357393609196351 798626687482351 1592846228397151 2943019447952311 4906907767305271 7584937293695671 10709305074484471 14094036837005671 17218404617794471 19862100432308071 21750454585532071 22964396541176071 23611832250852871 23913968915368711 24027270164562151 24062676804935101 24071007779140501 24072477951059101 24072641303494501 24072650378629801 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All the articles I've found via google are either obsolete or contradict one another.
All, I have some script tags that are not working in Wordpress. If I
All, Say I have the following bit of code: select: function(start, end, allDay) {
All, I have the following date: Wed Feb 01 2012 09:30:00 GMT-0600 (Central Standard
All, I have about 3000 words with definitions that I am loading into a
All, I have the following code: $fetch = mysql_query(SELECT * FROM calendar_events where event_status='booked'
All the examples of use and tutorials I have found on beginBackgroundTaskWithExpirationHandler: show how
All the day numbers and week days on twitter bootstrap date picker show up
all. Let's say I have a program that contains a long list of C
All, Wanted to get a few thoughts on this. Lately I am becoming more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.