• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:04
CEST 16:04
KST 23:04
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Weekly Cups (Oct 13-19): Clem Goes for Four0BSL Team A vs Koreans - Sat-Sun 16:00 CET6Weekly Cups (Oct 6-12): Four star herO85.0.15 Patch Balance Hotfix (2025-10-8)80Weekly Cups (Sept 29-Oct 5): MaxPax triples up3
StarCraft 2
General
The New Patch Killed Mech! Team Liquid Map Contest #21 - Presented by Monster Energy herO joins T1 Weekly Cups (Oct 13-19): Clem Goes for Four TL.net Map Contest #21: Voting
Tourneys
SC2's Safe House 2 - October 18 & 19 INu's Battles #13 - ByuN vs Zoun Tenacious Turtle Tussle Sparkling Tuna Cup - Weekly Open Tournament $1,200 WardiTV October (Oct 21st-31st)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers
Brood War
General
BSL Season 21 BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ BW caster Sayle BSL Team A vs Koreans - Sat-Sun 16:00 CET
Tourneys
[ASL20] Semifinal B Azhi's Colosseum - Anonymous Tournament [Megathread] Daily Proleagues SC4ALL $1,500 Open Bracket LAN
Strategy
Current Meta BW - ajfirecracker Strategy & Training Relatively freeroll strategies Siegecraft - a new perspective
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Dawn of War IV Nintendo Switch Thread ZeroSpace Megathread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Men's Fashion Thread Sex and weight loss
Fan Clubs
The herO Fan Club!
Media & Entertainment
Series you have seen recently... Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
Formula 1 Discussion 2024 - 2026 Football Thread MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
The Heroism of Pepe the Fro…
Peanutsc
Rocket League: Traits, Abili…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1532 users

The Math Thread - Page 22

Forum Index > General Forum
Post a Reply
Prev 1 20 21 22 23 24 32 Next All
CoughingHydra
Profile Blog Joined May 2012
177 Posts
Last Edited: 2018-10-18 16:41:09
October 18 2018 15:39 GMT
#421
I wouldn't have figured it out if you didn't say xor, but ok : P

+ Show Spoiler +
So let a_1,...,a_8 denote the levers and they are either 0 or 1. x will denote xor. Notice the nice property of xor that if a or b change then also a x b will change. Now it is easy to tell our friend the formula for the number he needs:

first binary decimal = a_1 x a_2 x a_5 x a_7
second = a_1 x a_3 x a_5 x a_6
third = a_1 x a_4 x a_6 x a_7

So now if the levers at the beginning give the required number pull lever a_8 (so no decimals will change). If you want to change all three decimals pull lever a_1. If you want to change only the first/second/third decimal pull a_2/a_3/a_4, and if you want to change a particular pair of decimals, pull one of the levers a_5, a_6 or a_7, depending which pair of course.


Edit: clarified a bit, Edit2: spoiler
Joni_
Profile Joined April 2011
Germany355 Posts
October 18 2018 15:55 GMT
#422
This might make your thoughts go into a good direction for finding the solution, although it is not the full solution yet. It makes finding the solution a lot easier, tho, hence the spoiler:

+ Show Spoiler +
I love this puzzle because thinking about it for a while makes you realise that there probably is no reason that this is abstractly any more "difficult" for 8 than for 4 or 2 levers and thinking about the solution for 2 levers actually can give you the correct idea for how to solve it with more levers.


Anyway, thank you for sharing that puzzle, it's just great! I had never heard it before and it just made me miss my rehearsal.
Geiko
Profile Blog Joined June 2010
France1939 Posts
Last Edited: 2018-10-18 16:59:43
October 18 2018 16:30 GMT
#423
Thanks guys you are awesome !

Thanks to you I now remember the way I used to solve this.

+ Show Spoiler +


Lets define for i=1 to 8, P(i)=base 2 writing of i

for example P(5)=(1;0;1)

Then N is base 2 writing of the number your friend has to guess.

for example if you must guess 7, then N=(1;1;1)

Then define S=XOR P(i) for all levers i that are ON

for example if levers 1, 4 and 7 are ON, then S=(0;0;1) XOR (1;0;0) XOR (1;1;1) = (0;1;0)

Then define T=S XOR N and j such that P(j)=T

in our example T=(0;1;0) XOR (1;1;1) = (1;0;1) = P(5)

If you pull lever j, and ask your friend to calculate S2 (which is S once you've pulled lever j), he'll get
S XOR T = S XOR S XOR N = N which is the number he needs to find !

in our example you pull lever 5, so he finds levers 1,4,5 and 7 ON so S2= (0;0;1) XOR (1;0;0) XOR (1;0;1) XOR (1;1;1) =(1;1;1) = P(7), so the number is 7 !





edit: clarification
geiko.813 (EU)
CoughingHydra
Profile Blog Joined May 2012
177 Posts
October 18 2018 16:37 GMT
#424
On October 19 2018 00:55 Joni_ wrote:
This might make your thoughts go into a good direction for finding the solution, although it is not the full solution yet. It makes finding the solution a lot easier, tho, hence the spoiler:

+ Show Spoiler +
I love this puzzle because thinking about it for a while makes you realise that there probably is no reason that this is abstractly any more "difficult" for 8 than for 4 or 2 levers and thinking about the solution for 2 levers actually can give you the correct idea for how to solve it with more levers.


Anyway, thank you for sharing that puzzle, it's just great! I had never heard it before and it just made me miss my rehearsal.

Actually trying for 2 levers missguided me xD since one can just write down all the cases and make the partition himself. But yeah my solution above can be easily generalised.
opisska
Profile Blog Joined February 2011
Poland8852 Posts
October 18 2018 16:39 GMT
#425
Two levers have a much simpler solution though: ignore one lever, the other one is 1 up 2 down. That's easy enough even for me not to mess up
"Jeez, that's far from ideal." - Serral, the king of mild trashtalk
TL+ Member
Joni_
Profile Joined April 2011
Germany355 Posts
Last Edited: 2018-10-19 23:43:10
October 18 2018 21:48 GMT
#426
On October 19 2018 01:39 opisska wrote:
Two levers have a much simpler solution though: ignore one lever, the other one is 1 up 2 down. That's easy enough even for me not to mess up

True! 2 levers has several solutions that cannot be generalised, maybe messing with 4 levers can guide one towards salvation. =)

edit: This post was previously misleading... :>
Nebuchad
Profile Blog Joined December 2012
Switzerland12302 Posts
Last Edited: 2018-11-18 12:51:47
November 18 2018 12:48 GMT
#427
Hi guys, I still suck at math

I'm using a program that calculates equity for different ranges in poker (hold'em). Here's the data I have:

Number of tries (exhaustive):
403835094432

Range 1 wins: 142599616520
Range 1 ties: 10945429968
Range 2 wins: 140980819160
Range 2 ties: 11040244316
Range 3 wins: 108972219224
Range 3 ties: 2243569640

Range 1 wins %: 35,3113%
Range 1 ties %: 2,7104%
Range 2 wins %: 34,9105%
Range 2 ties %: 2,7338%
Range 3 wins %: 26,9843%
Range 3 ties %: 0,5556%

Range 1 equity: 36,5978%
Range 2 equity: 36,2087%
Range 3 equity: 27,1934%

I'm trying to determine how the program got the equity from the data.

Obviously you get the win equity by going (number of wins*100)/number of tries, and the tie equity by going (number of ties*100)/number of tries.

My understanding is that the equity percent is (wins%) + (part of ties% that are ties with only one player/2) + (part of ties% that are ties with both other players/3) - (because when you win you get all the money, when you tie with one player you get half and when you tie with both you get a third)

I run into an issue because the program doesn't let me know how often you tie with one player and how often you tie with both players.

I've been playing around with the numbers and I got the right results.

I added wins for all players and (tie/2) for all players. I get slightly over 100%, because some of the ties should have been /3 instead of /2.

I took the amount that was above 100% and did that *2, then /3.

Then I substracted that result from the number of ties for one player

Then I did number of wins for that player + (that result/2), and I got the right answer. I don't understand why. Shouldn't I also have had to divide an amount by 3?
No will to live, no wish to die
KR_4EVR
Profile Joined July 2017
316 Posts
November 18 2018 19:24 GMT
#428
On November 18 2018 21:48 Nebuchad wrote:
Hi guys, I still suck at math

I'm using a program that calculates equity for different ranges in poker (hold'em). Here's the data I have:

Number of tries (exhaustive):
403835094432

Range 1 wins: 142599616520
Range 1 ties: 10945429968
Range 2 wins: 140980819160
Range 2 ties: 11040244316
Range 3 wins: 108972219224
Range 3 ties: 2243569640

Range 1 wins %: 35,3113%
Range 1 ties %: 2,7104%
Range 2 wins %: 34,9105%
Range 2 ties %: 2,7338%
Range 3 wins %: 26,9843%
Range 3 ties %: 0,5556%

Range 1 equity: 36,5978%
Range 2 equity: 36,2087%
Range 3 equity: 27,1934%

I'm trying to determine how the program got the equity from the data.

Obviously you get the win equity by going (number of wins*100)/number of tries, and the tie equity by going (number of ties*100)/number of tries.

My understanding is that the equity percent is (wins%) + (part of ties% that are ties with only one player/2) + (part of ties% that are ties with both other players/3) - (because when you win you get all the money, when you tie with one player you get half and when you tie with both you get a third)

I run into an issue because the program doesn't let me know how often you tie with one player and how often you tie with both players.

I've been playing around with the numbers and I got the right results.

I added wins for all players and (tie/2) for all players. I get slightly over 100%, because some of the ties should have been /3 instead of /2.

I took the amount that was above 100% and did that *2, then /3.

Then I substracted that result from the number of ties for one player

Then I did number of wins for that player + (that result/2), and I got the right answer. I don't understand why. Shouldn't I also have had to divide an amount by 3?


Let me simplify your problem for you. You have possible 7 real probabilities, 'hidden data'.

1 wins, rest lose = a
2 wins, rest lose =b
3 wins, rest lose =c
1 ties 2, 3 loses = d
1 ties 3 , 2 loses=e
2 ties 3, 1 loses=f
1 ties 2 ties 3 = g

You also have the individual perspectives:
1 wins, 1 ties, 1 loses = h,i,j
2 wins, 2 ties, 2 loses = k,l,m
3 wins, 3 ties, 3 loses = n, o, p

Now you know that the probability of 1 tying is the sum of probability of tying:

h = a; (d+e)=(x) i, g = (1-x) i

Here x is the fraction of ties that are 2-way instead of 3-way.

OK. Now let's talk about normalized payout (assuming each round is same money). Let's assume in a tie of N players the payout is 1/N. So if there is one winner, payout is 1, payout is 1/2 in a two way tie, and payout is 1/3 in a 3-way tie.

Now we have the real question: what is the payout player 1 shoud expect? It is E= a+(d+e)/2+g/3. This number is player 1's equity. It is also E = a + ix/2+i(1-x)/3.

Solving this for x one obtains finds 6(E-a)/i = x = 6(E-h)/i

This is the fraction of ties which were 2-way (obviously 1-x then are the fraction of ties which were 1-way.)

Now you can use this to determine (d+e) and g.

Let's summarize. You originally knew for each player what fraction he uniquely won and tied, as well as his payout. For each player, we broke that tied piece into two pieces: fraction of ties 2-way and 3-way. This depended on a single variable x. We solved for x using the payout function, and then can multiply the fraction back to determine the hidden info.
Et tu Brute ?
Nebuchad
Profile Blog Joined December 2012
Switzerland12302 Posts
Last Edited: 2018-11-18 21:59:47
November 18 2018 21:17 GMT
#429
Thanks, that makes sense to me. I should have mentioned that we don't really have E (or at least the goal is to find E, cause that's not the exact percentage (full disclosure I have another set of ranges that also rounds down to 27,1934% and I wanted to find the complete number to know which of the two is actually ahead), but I think I got this from here:

i = ((d+e)/2)+(g/3)
l = ((d+f)/2)+(g/3)
o = ((e+f)/2)+(g/3)
100 = h+k+n+(d/2)+(e/2)+(f/2)+(g/3)

should be enough information to find the 4 variables d e f g, I believe. Will look more closely when I get back home.

Is it just a coincidence that I got the "right" result with my random attempts earlier?
No will to live, no wish to die
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2018-11-18 23:33:32
November 18 2018 23:33 GMT
#430
well, there is missing information

this is poker, so what is in the pot. are there blinds, antes? what is the bet? is this allin preflop? is it just assumed this is a 1 on 1 on 1 scenario where each player contributes 33% of the pot?
Nebuchad
Profile Blog Joined December 2012
Switzerland12302 Posts
November 19 2018 17:57 GMT
#431
On November 19 2018 08:33 travis wrote:
well, there is missing information

this is poker, so what is in the pot. are there blinds, antes? what is the bet? is this allin preflop? is it just assumed this is a 1 on 1 on 1 scenario where each player contributes 33% of the pot?


Those informations aren't needed to calculate the equity vs range, they are needed to figure out how much equity you need to continue with the hand
No will to live, no wish to die
DarkPlasmaBall
Profile Blog Joined March 2010
United States44915 Posts
November 20 2018 18:36 GMT
#432
When I was doing my master's in math education, I took an awesome course called Problem Solving. We met once per week, for a three-hour block of time, and our professor would give us exactly one new problem to work on. We'd collaborate and explore the problem, tinker with a bunch of different strategies, try to solve the problem in as many ways as possible, consider additional extensions to the problem, and then reflect on and analyze the entire process.

My favorite problem in that class- which has come to be my favorite math problem of all time- is The Doubling Problem. Today and tomorrow I'm giving it to my high school math students (as it's right before Thanksgiving break, so I'd rather have the students play around with an interesting problem like this instead of trying to force down a final lesson and risk them losing focus).

The Doubling Problem is remarkably simple to explore, as it's just based on addition, multiplication, and moving around digits of a number. Thanks to its low mathematics entry point, I have plenty of students (and not just honors/ AP/ high-level students) who are making progress in solving the problem (or have already solved it).

Without further ado, I challenge you to solve The Doubling Problem (please spoiler your answers):

Pick a positive whole number. We’re going to apply a special rule to this number: take the last digit of that number (the ones’ digit) and move it to the front of the number. For example: 1234 becomes 4123 because the 4 is moved to the front, 567 becomes 756, 9002 becomes 2900, etc.
Can you find a positive whole number such that, when you apply this rule to it, the resulting number is double the original number?
"There is nothing more satisfying than looking at a crowd of people and helping them get what I love." ~Day[9] Daily #100
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
November 20 2018 19:21 GMT
#433
On November 21 2018 03:36 DarkPlasmaBall wrote:
When I was doing my master's in math education, I took an awesome course called Problem Solving. We met once per week, for a three-hour block of time, and our professor would give us exactly one new problem to work on. We'd collaborate and explore the problem, tinker with a bunch of different strategies, try to solve the problem in as many ways as possible, consider additional extensions to the problem, and then reflect on and analyze the entire process.

My favorite problem in that class- which has come to be my favorite math problem of all time- is The Doubling Problem. Today and tomorrow I'm giving it to my high school math students (as it's right before Thanksgiving break, so I'd rather have the students play around with an interesting problem like this instead of trying to force down a final lesson and risk them losing focus).

The Doubling Problem is remarkably simple to explore, as it's just based on addition, multiplication, and moving around digits of a number. Thanks to its low mathematics entry point, I have plenty of students (and not just honors/ AP/ high-level students) who are making progress in solving the problem (or have already solved it).

Without further ado, I challenge you to solve The Doubling Problem (please spoiler your answers):

Pick a positive whole number. We’re going to apply a special rule to this number: take the last digit of that number (the ones’ digit) and move it to the front of the number. For example: 1234 becomes 4123 because the 4 is moved to the front, 567 becomes 756, 9002 becomes 2900, etc.
Can you find a positive whole number such that, when you apply this rule to it, the resulting number is double the original number?


+ Show Spoiler +

This looks rather trivial tbh.
It took me like 2 minutes in excel to find 105263157894736842. Obviously there more solutions (e.g. concatenating this number with itself, but you most likely can also use different starters, didnt check)

All I did was:
r_0 = 0
p_0 = d
d_i = (p_i*2)%10

r_(i+1) = (p_i*2)/10 (/ used in the integer sense)
p_(i+1) = d_i+r_(i+1)

Abort when: p_x = p_0 AND p_(x-1) != 0 AND r_x == 0

For d you can put in any digit and see if it terminates. It doesn't for d=1, but it does for d=2 and gives aboves solution.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
November 20 2018 19:32 GMT
#434
I wouldn't consider that trivial
DarkPlasmaBall
Profile Blog Joined March 2010
United States44915 Posts
November 20 2018 19:43 GMT
#435
On November 21 2018 04:21 mahrgell wrote:
Show nested quote +
On November 21 2018 03:36 DarkPlasmaBall wrote:
When I was doing my master's in math education, I took an awesome course called Problem Solving. We met once per week, for a three-hour block of time, and our professor would give us exactly one new problem to work on. We'd collaborate and explore the problem, tinker with a bunch of different strategies, try to solve the problem in as many ways as possible, consider additional extensions to the problem, and then reflect on and analyze the entire process.

My favorite problem in that class- which has come to be my favorite math problem of all time- is The Doubling Problem. Today and tomorrow I'm giving it to my high school math students (as it's right before Thanksgiving break, so I'd rather have the students play around with an interesting problem like this instead of trying to force down a final lesson and risk them losing focus).

The Doubling Problem is remarkably simple to explore, as it's just based on addition, multiplication, and moving around digits of a number. Thanks to its low mathematics entry point, I have plenty of students (and not just honors/ AP/ high-level students) who are making progress in solving the problem (or have already solved it).

Without further ado, I challenge you to solve The Doubling Problem (please spoiler your answers):

Pick a positive whole number. We’re going to apply a special rule to this number: take the last digit of that number (the ones’ digit) and move it to the front of the number. For example: 1234 becomes 4123 because the 4 is moved to the front, 567 becomes 756, 9002 becomes 2900, etc.
Can you find a positive whole number such that, when you apply this rule to it, the resulting number is double the original number?


+ Show Spoiler +

This looks rather trivial tbh.
It took me like 2 minutes in excel to find 105263157894736842. Obviously there more solutions (e.g. concatenating this number with itself, but you most likely can also use different starters, didnt check)

All I did was:
r_0 = 0
p_0 = d
d_i = (p_i*2)%10

r_(i+1) = (p_i*2)/10 (/ used in the integer sense)
p_(i+1) = d_i+r_(i+1)

Abort when: p_x = p_0 AND p_(x-1) != 0 AND r_x == 0

For d you can put in any digit and see if it terminates. It doesn't for d=1, but it does for d=2 and gives aboves solution.


+ Show Spoiler +
Yup, that's a solution Of course, keep in mind that my students are merely using basic calculators and pencils and paper, rather than software and computer code
"There is nothing more satisfying than looking at a crowd of people and helping them get what I love." ~Day[9] Daily #100
Simberto
Profile Blog Joined July 2010
Germany11594 Posts
Last Edited: 2018-11-20 19:53:15
November 20 2018 19:51 GMT
#436
Thanks for the problem, that was fun!

+ Show Spoiler +

105263157894736842

Found by starting with "The last number needs to be double the first, so lets start with 2". Then every digit in ahead of it needs to be double the previous one, and if that meant that you would need to go above 9, the excess one seeps over to the digit ahead of that.
So 2 as last digit means it needs to be 42
42 means it needs to be 842
842 means 6842, with a 1 added to the next number, notated as (1)6842 in the future
(1)6842 means (1)36842
(1)36842 means 736842
repeat until you reach a one in the first position, without any saved 1.
DarkPlasmaBall
Profile Blog Joined March 2010
United States44915 Posts
November 20 2018 19:53 GMT
#437
On November 21 2018 04:51 Simberto wrote:
Thanks for the problem, that was fun!

+ Show Spoiler +

105263157894736842

Found by starting with "The last number needs to be double the first, so lets start with 2. Then every digit in ahead of it needs to be double the previous one, and if that meant that you would need to go above 9, the excess one seeps over to the digit ahead of that.
So 2 as last digit means it needs to be 42
42 means it needs to be 842
842 means 6842, with a 1 added to the next number, notated as (1)6842 in the future
(1)6842 means (1)36842
(1)36842 means 736842
repeat until you reach a one in the first position, without any saved 1.


+ Show Spoiler +
Nice job! That's how I first solved and explained it, and that's how my students are approaching it as well
"There is nothing more satisfying than looking at a crowd of people and helping them get what I love." ~Day[9] Daily #100
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
January 10 2019 15:44 GMT
#438
I'm trying to figure out how this algorithm works, https://en.wikipedia.org/wiki/Prime-counting_function, under the section "Algorithms for evaluating π(x)", using Legendre's inclusion-exlusion principle. For whatever reason I'm not getting the numbers I would expect.

Suppose x = 32. It says "p1, p2, p3, pn are the prime numbers less than or equal to the square root of x." Sqrt(32) = 5, so then it would be p1 = 2, p2 = 3, and p3 = 5. Now if I understand the formula (I'm not very good with formula notation), it seems to be then:

32 - (floor(32/2) + floor(32/3) + floor(32/5)) + (floor(32/(2*3)) + floor(32/(2*5)) + floor(32/(3*5))) - floor(32/(2*3*5)) + 1

The number I get is 10, but there are 11 prime numbers up to 32. This variance only grows the larger the number. Am I misunderstanding this algorithm?
TBO
Profile Joined September 2009
Germany1350 Posts
January 10 2019 16:00 GMT
#439
On November 21 2018 03:36 DarkPlasmaBall wrote:
When I was doing my master's in math education, I took an awesome course called Problem Solving. We met once per week, for a three-hour block of time, and our professor would give us exactly one new problem to work on. We'd collaborate and explore the problem, tinker with a bunch of different strategies, try to solve the problem in as many ways as possible, consider additional extensions to the problem, and then reflect on and analyze the entire process.

My favorite problem in that class- which has come to be my favorite math problem of all time- is The Doubling Problem. Today and tomorrow I'm giving it to my high school math students (as it's right before Thanksgiving break, so I'd rather have the students play around with an interesting problem like this instead of trying to force down a final lesson and risk them losing focus).

The Doubling Problem is remarkably simple to explore, as it's just based on addition, multiplication, and moving around digits of a number. Thanks to its low mathematics entry point, I have plenty of students (and not just honors/ AP/ high-level students) who are making progress in solving the problem (or have already solved it).

Without further ado, I challenge you to solve The Doubling Problem (please spoiler your answers):

Pick a positive whole number. We’re going to apply a special rule to this number: take the last digit of that number (the ones’ digit) and move it to the front of the number. For example: 1234 becomes 4123 because the 4 is moved to the front, 567 becomes 756, 9002 becomes 2900, etc.
Can you find a positive whole number such that, when you apply this rule to it, the resulting number is double the original number?


+ Show Spoiler +
if there is a solution depends on the base I think. for base2 there should be none (if you don't allow leading 0s at least - else you have 01 -> 10). Does anyone have a clue if it is solvable for all bases bigger than a certain value or if iit is solvable for some and not solvable for others and if there is a pattern which influences that?

Simberto
Profile Blog Joined July 2010
Germany11594 Posts
January 10 2019 17:01 GMT
#440
On January 11 2019 00:44 enigmaticcam wrote:
I'm trying to figure out how this algorithm works, https://en.wikipedia.org/wiki/Prime-counting_function, under the section "Algorithms for evaluating π(x)", using Legendre's inclusion-exlusion principle. For whatever reason I'm not getting the numbers I would expect.

Suppose x = 32. It says "p1, p2, p3, pn are the prime numbers less than or equal to the square root of x." Sqrt(32) = 5, so then it would be p1 = 2, p2 = 3, and p3 = 5. Now if I understand the formula (I'm not very good with formula notation), it seems to be then:

32 - (floor(32/2) + floor(32/3) + floor(32/5)) + (floor(32/(2*3)) + floor(32/(2*5)) + floor(32/(3*5))) - floor(32/(2*3*5)) + 1

The number I get is 10, but there are 11 prime numbers up to 32. This variance only grows the larger the number. Am I misunderstanding this algorithm?


The first thing i notice is that Sqrt 32 =/= 5

Sqrt 32 = 4*Sqrt(2), which would round to 5.66, but that isn't relevant due to the fact that you are looking for primes less than or equal to Sqrt 32

Furthermore, what you are counting are not the prime numbers up to 32, but, as the article clearly states, Pi(x) - Pi(Sqrt(x)) + 1.

I also don't think you should add that 1 at the end of your addition.

Thus, the number you calculate is

32 - (16+10+6)+(5+3+2)-1
= 9

Which is exactly what the result should be, since

Pi(32)-Pi(Sqrt(32))+1
= 11 - 3 + 1 =9

Carefully reread what the wiki article actually states.
Prev 1 20 21 22 23 24 32 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 1h 56m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Harstem 586
sas.Sziky 24
LamboSC2 22
StarCraft: Brood War
Britney 35377
Calm 10586
Hyuk 4881
Bisu 3161
GuemChi 2855
Horang2 2527
Flash 1895
Jaedong 1193
EffOrt 699
Larva 611
[ Show more ]
Soma 605
Light 451
actioN 327
Soulkey 293
Mong 255
Snow 254
Mini 231
Hyun 200
hero 157
Pusan 90
JYJ83
TY 78
ggaemo 72
Barracks 71
JulyZerg 62
Mind 61
Sea.KH 61
sorry 54
Killer 54
Rush 40
Aegong 37
scan(afreeca) 34
Noble 28
ToSsGirL 24
Sharp 20
soO 18
Terrorterran 18
Movie 16
Sacsri 15
Bale 13
SilentControl 12
yabsab 8
HiyA 8
Shine 7
Dota 2
Gorgc5756
qojqva3433
Dendi1111
XaKoH 436
420jenkins377
XcaliburYe181
Counter-Strike
byalli136
oskar121
markeloff88
edward19
Heroes of the Storm
Khaldor196
Other Games
summit1g9573
singsing2619
hiko1072
B2W.Neo879
Sick356
Lowko326
Hui .297
Happy186
ArmadaUGS51
Mew2King39
Organizations
Counter-Strike
PGL135
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 61
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 24
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2093
League of Legends
• Nemesis8427
Upcoming Events
Monday Night Weeklies
1h 56m
Replay Cast
8h 56m
WardiTV Invitational
20h 56m
WardiTV Invitational
1d
PiGosaur Monday
1d 9h
Replay Cast
1d 19h
Tenacious Turtle Tussle
2 days
The PondCast
2 days
OSC
2 days
WardiTV Invitational
3 days
[ Show More ]
Online Event
4 days
RSL Revival
4 days
RSL Revival
4 days
WardiTV Invitational
4 days
Afreeca Starleague
5 days
Snow vs Soma
Sparkling Tuna Cup
5 days
WardiTV Invitational
5 days
CrankTV Team League
5 days
RSL Revival
6 days
Wardi Open
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
BSL 21 Non-Korean Championship
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.