Number of digits in 1…n Let n be a positve integer. Consider the task of printing all the numbers f

shmilybaby4i 2022-06-24 Answered
Number of digits in 1…n
Let n be a positve integer. Consider the task of printing all the numbers from 1 to n. For example, 512 has three digits.
When n is small,the task can be completed quickly; when n is large it can take a long time.
How many digits does it take to print these numbers?
You can still ask an expert for help

Want to know more about Discrete math?

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

Solve your problem for the price of one coffee

  • Available 24/7
  • Math expert for every subject
  • Pay only if we can solve it
Ask Question

Answers (1)

Carmelo Payne
Answered 2022-06-25 Author has 25 answers
Step 1
A whole sequence of k digits numbers (from 10 k 1 to 10 k 1) totals 9 k 10 k 1 digits. If n has m digits, the last incomplete sequence totals m ( n 10 m 1 + 1 ) digits.
Step 2
Hence, k = 1 m 1 9 k 10 k 1 + m ( n 10 m 1 + 1 ) = m ( n + 1 ) 10 m 1 9
with m := log 10 n + 1.

We have step-by-step solutions for your answer!

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

You might be interested in

asked 2021-08-15
How many elements are in the set { 0, { { 0 } }?
asked 2021-08-18
Discrete Mathematics Basics
1) Determine whether the relation R on the set of all Web pages is reflexive, symmetric, antisymmetric, and/or transitive, where (a,b)R if and only if
I) everyone who has visited Web page a has also visited Web page b.
II) there are no common links found on both Web page a and Web page b.
III) there is at least one common link on Web page a and Web page b.
asked 2021-08-02
Suppose that A is the set of sophomores at your school and B is the set of students in discrete mathematics at your school. Express each of these sets in terms of A and B.
a) the set of sophomores taking discrete mathematics in your school
b) the set of sophomores at your school who are not taking discrete mathematics
c) the set of students at your school who either are sophomores or are taking discrete mathematics
Use these symbols:
asked 2021-07-28

Let A, B, and C be sets. Show that (AB)C=(AC)(BC)
image

asked 2022-06-09
Is there a Horn formula which is equivalent to ( p q )?
Is there a Horn formula which is equivalent to ( p q )?
Given any formula ϕ, is it possible to find a Horn formula equivalent to ϕ?
I know that a formula is Horn's if in its conjunctive normal form all clauses are Horn's.
But in this case ϕ is already in it's conjunctive normal form, but ϕ has 2 positive literal.
So, this would be a example that proves that what I have to answer is not possible, right?
Thanks in advance
UPDATE
I just thought of something; let me know if I'm right.
So a Horn Clause has the form:
a) ( p 1 . . . p n ) q
b) ¬ p 1 ¬ p 2 , . . . , ¬ p n
Since ( p q ) is not equivalent to ( p q ) s, and ( p q ) is not equivalent to ( ¬ p ¬ q ).
There ( p q ) can't be equivalent to any Horn formula.
asked 2022-09-07
I wanted to ask here if this proving process were correct:
f ( a ) = a div d
We must show this is an onto function
If it is onto, then y in the codomain, a in the domain such that f ( a ) = y
Consider an arbitrary y in the codomain. We know that f ( a ) = y if and only if a div d = y.
a div d = y implies that a = d y + r .
But then f ( d y + r ) = y because:
f ( d y + r )= ( d y + r ) div d meanining that
d y + r = d q + k where q= ( d y + r ) div d
Now since a = d y + r, a mod d is equal to ( d y + r ) mod d so k = r
This means that:
d y + r = d q + r, so the quotient q of d y + r is y. But then f ( d y + r ) = y, so for an arbitray y, there is an element d y + r in the domain such that f ( d y + r ) is y, as we wanted to show.
asked 2022-07-10
How to show that the complement of Cartesian product of two non-empty sets is not the same as the Cartesian product of their complements?
( A × B ) C = ( A C × B C ) ( A C × B ) ( A × B C )
I wanted to do it like this:
A × B = { ( a , b ) A × B | a A b B }
Taking complement, A × B ¯ = { ( a , b ) A × B | a A b B }
Because ( a , b ) A × B prevents me from going anywhere, I chose to do:
Let A × B X × Y
Then, A × B = { ( a , b ) X × Y | a A b B } and A × B ¯ = { ( a , b ) X × Y | a A b B }
But I'm unsure about the correctness of what I did from here.
A × B ¯ = { ( a , b ) X × Y | ( a A b B ) ( a A b B ) ( a A b B ) }
Therefore, A × B ¯ = { ( a , b ) X × Y | ( a A b B ) } { ( a , b ) X × Y | ( a A b B ) } { ( a , b ) X × Y | ( a A b B ) } which gives
We know A × B A × B.
Hence, A × B ¯ = ( A ¯ × B ¯ ) ( A ¯ × B ) ( A × B ¯ ).
"Derive" instead of "prove" because I don't need to prove the equivalence per se. I'm just trying to see how the LHS can lead to the RHS. I should've been more careful about the wording

New questions

Solve your problem for the price of one coffee

  • Available 24/7
  • Math expert for every subject
  • Pay only if we can solve it
Ask Question