What is the probability that the product of the digits is odd?

  • #1
littlemathquark
44
11
TL;DR Summary
What is the probability that the product of the digits in any selected positions of a randomly chosen digit natural number is odd?
I have two solutions, but I have no idea which solution correct. Both of them seem correct to me. Help please.

First solution:
There is an infinite number of natural numbers.
Product of digits is odd only if all digits in number are odd.

Counting natural numbers with all odd digits:

1-digit: 5
2-digit: 5*5
3-digit: 5*5*5
4-digit: 5*5*5*5=5^4

n-digit: 5^n

If we want probability for natural numbers up to n-digits:

Total number of odd-product numbers is :

5+5^2+5^3+…+5^n=5*(1+5+5^2+…+5^(n-1))=5*(5^n-1)/(5–1)=5/4*(5^n-1)

p(n)=5/4*(5^n-1)/(10^n-1)

If n is going to the infinity p(n) is going to 0.

Second solution:
Depends on the length of the digit string.

The more digits there are in a number, the greater the probability that at least one of them is even. If any of them are even, the product is even.

So really the question reduces to the probability that all the digits are odd, and that’s just inverse powers of 2…

1 digit: 1/2 = 50%

2 digits: 1/(2²) = 25%

3 digits: 1/(2³) = 12.5%

and so on.
 
  • Like
Likes apostolosdt
Physics news on Phys.org
  • #2
littlemathquark said:
First solution:
There is an infinite number of natural numbers.
There is no uniform distribution on the natural numbers. It's only possible on a finite subset.

The best you can do is to take the limit as ##N \to \infty## for a subset of ##N## natural numbers. In this case, it's pretty clear that the proportion of natural numbers with all odd digits goes to zero as ##N \to \infty##.
 
Last edited:
  • Like
Likes fresh_42
  • #3
The probability is zero.
 
  • #4
littlemathquark said:
TL;DR Summary: What is the probability that the product of the digits in any selected positions of a randomly chosen digit natural number is odd?

I have no idea which solution correct. Both of them seem correct to me.
They are both correct.
 
  • #5
But one of them p(1)=5/9 but for other solution(second) p(1)=1/2.which is correct?
 
  • #7
littlemathquark said:
But one of them p(1)=5/9 but for other solution(second) p(1)=1/2.which is correct?
Maybe in the first case you didn't count zero as an even number and the second case you did
 
  • Like
Likes Dale and Gavran
  • #8
Hornbein said:
Maybe in the first case you didn't count zero as an even number and the second case you did
And not only ## 0 ##.
In the second solution the original poster has included ## 00 ## into 2-digit natural numbers, ## 000 ## into 3-digit natural numbers, ## 0000 ## into 4-digit natural numbers and so on, and that is wrong.
 
  • #9
What is the probability that the product of the digits in any k selected positions of a randomly chosen n-digit natural number is odd?
What about this question? Are solution the same?
 
  • #10
littlemathquark said:
What is the probability that the product of the digits in any k selected positions of a randomly chosen n-digit natural number is odd?
What about this question? Are solution the same?
That's just slightly tricky in that an n-digit number has a first digit that is randomly 1-9 and n-1 digits that are randomly 0-9.

You could calculate the two cases where the first digit is or is not in the k digits separately.
 
  • #11
The digits that make a number even are 2,4,6,8. So 6 of the digits will keep the product odd.

0.6^(n-1)*5/9 = 0.6^n * 25/27
 
  • #12
Hornbein said:
The digits that make a number even are 2,4,6,8. So 6 of the digits will keep the product odd.

0.6^(n-1)*5/9 = 0.6^n * 25/27
On second thought, if any one of the digits is zero then the product is zero. Is that even or odd?
 
  • #13
Hornbein said:
On second thought, if any one of the digits is zero then the product is zero. Is that even or odd?
Zero is even.
 
  • Like
Likes Gavran

Similar threads

Back
Top