My Math Forum  

Go Back   My Math Forum > College Math Forum > Advanced Statistics

Advanced Statistics Advanced Probability and Statistics Math Forum


Reply
 
LinkBack Thread Tools Display Modes
November 19th, 2013, 07:17 PM   #1
Newbie
 
Joined: Nov 2013

Posts: 7
Thanks: 0

Help me with some basic maths!

Hi guys, hoping someone can help me with this. Pretty simple stuff but maths was never my strong suit.

So lets imagine a combination lock with four values in length. The first value is from a choice of two numbers, the second from a choice of two numbers, the third from a choice of four numbers and the fourth from a choice of four numbers.

So it would look like this

? ? ? ? <-- possible combination made from numbers below
1 1 1 1
2 2 2 2
3 3
4 4
(a b c d)

That would provide 64 combinations right? You would go 2x2x4x4=64, is that right?

So to get a bit trickier, if a combination was randomly generated and you had to solve it but knew that 70% of the time the value in column A was the number 1 and 80% of the time the value in column B was the number 1, what do you think would be the potential amount of combinations likely entered before the code was cracked? It would surely be better than 1 in 64 odds.

I'm mainly interested in how to work that out so I can change values and percentages and come up with likely odds to crack a code.

Disclaimer - I'm not trying to crack anyones code on anything which should be obvious as getting past a combination lock forcefully is rather easy. I'm working on a project and need some stats, I tried to find some online calculators to work out the above but no dice.

What do you all think?
Ajax is offline  
 
November 19th, 2013, 11:50 PM   #2
Senior Member
 
Joined: Jun 2013
From: London, England

Posts: 1,316
Thanks: 116

Re: Help me with some basic maths!

If you know that the numbers in the combinations are not equally likely, then the probability of guessing it correctly in this case would be:

(0.7)(0.8 )(0.25)(0.25)

If you always guess 1 in colums 1 and 2. So, much better than 1/64.

The "expected" number of attempts to guess the right combination is 32.5 in the first case. And every strategy is as good as any other.

In the second case, the best strategy is to guess all the combinations 11xy, then 21xy, then 12xy then 22xy. THis gives you:

0.56 probability of guessing it in the first 16 (expected number = 8.5)

0.24 probability of guessing it in the next 16 (expected number = 24.5)

0.14 probability of guessing it in the next 16 (expected number = 40.5)

0.06 probability of guessing it in the last 16 (expected number = 56.5)

So, the overall expected number of attempts to guess the combination is: 19.7
Pero is offline  
November 20th, 2013, 01:38 AM   #3
Newbie
 
Joined: Nov 2013

Posts: 7
Thanks: 0

Re: Help me with some basic maths!

Thank you Pero.

So I was wrong in guessing that there are 64 combinations. I'd like to understand in both instances how the calculation is done if you can help me with that one?

As I mentioned it is for a project and I will be changing the percentages of a likely number in any given column to show various things, if I could learn how to do the calcualtion it will be a big help!
Ajax is offline  
November 20th, 2013, 03:25 AM   #4
Senior Member
 
Joined: Jun 2013
From: London, England

Posts: 1,316
Thanks: 116

Re: Help me with some basic maths!

There are always 64 combinations. What you're changing is how likely any combination is.

If the combinations are all equally likely, then there is no best strategy to find it. Your chance of finding it the first time is 1/64. And, you can expect, on average, to take 32.5 guesses (that's just the average of 1-64).

If you know that certain numbers are more likely in certain positions, then your best strategy is to try those first. In this case, your chance of finding it first time is better than 1/64 and the expected number of guesses will be less than 32.5.

In your example, the chances of guessing it first time would be 3.5% (assuming you guessed 11xy, where x and y could be anything). And, the expected number of guesses would be only 19.7.

In general, you can follow the same startegy: always go for the numbers in order of likelihood in each place.

To do the calculations, you need to understand basic probability theory.
Pero is offline  
November 20th, 2013, 04:13 AM   #5
Newbie
 
Joined: Nov 2013

Posts: 7
Thanks: 0

Re: Help me with some basic maths!

I'm starting to wonder if I've formed this as a question that is relevant to my needs.

I used the concept of a code as I thought it fit well. In reality what is happening is that the 'code' is a random selection of choices. What I am trying to work out is not so much how many attempts to find the same code would take with some clever thinking but rather how many random selections would yield the same code if some of the selections were more likely to appear, ie number 1 in 70% of cases with column A and number 1 in 80% of cases with column B.

In all likely hood what you are saying could be considered right for what I just explained above if I'm understanding all of this correctly as even with a completely random selection using the 70 & 80 percentages in the first two columns it should mean that a matching code will statistically be found after 19.7 other codes being generated.

Sounds like I'm just rewording things now but its all the same. Argh, math, definitely not my strong suit.
Ajax is offline  
November 20th, 2013, 04:31 AM   #6
Senior Member
 
Joined: Jun 2013
From: London, England

Posts: 1,316
Thanks: 116

Re: Help me with some basic maths!

One thing to understand is the difference between "random" and "equally likely". The codes generated are still random, but no longer equally likely.

So, yes, you will get the same code more often. E.g. with 80% for 1 in place 2:

2134 will occur 4 times more often than 2234. It's still random, in the sense that you cannot predict when you get 2134 and 2234, but now 2134 is 4 times more likley.

You are on the right track. But without understanding probability it will be tough!
Pero is offline  
November 20th, 2013, 04:41 AM   #7
Senior Member
 
Joined: Jun 2013
From: London, England

Posts: 1,316
Thanks: 116

Re: Help me with some basic maths!

Quote:
Originally Posted by Ajax
What I am trying to work out is not so much how many attempts to find the same code would take with some clever thinking but rather how many random selections would yield the same code if some of the selections were more likely to appear, ie number 1 in 70% of cases with column A and number 1 in 80% of cases with column B.
This is relatively simple. In the example, 0.56 (56%) start 11, so every combination that starts 11 has 3.5% probability. Note that 16 x 3.5% - 56%.

24% start 21, so every combinatios that starts 21 has 1.5% probability.

14% start 12, so every combination that starts 12 has (14/16)% probability.

6% start 22, so every combination that starts 22 has (6/16)% probability.
Pero is offline  
November 20th, 2013, 08:26 PM   #8
Newbie
 
Joined: Nov 2013

Posts: 7
Thanks: 0

Re: Help me with some basic maths!

Thank you Pero.

I just tried to send you a PM but it seems I am unable to compose messages being so new to the forum. When you get a moment could you please PM me as I'd like to ask you a question.
Ajax is offline  
November 25th, 2013, 03:23 AM   #9
Newbie
 
Joined: Nov 2013

Posts: 7
Thanks: 0

Re: Help me with some basic maths!

I realise I've made a mistake in my original sample above. I had meant to write it out like this, not sure if it will make a difference to the 19.7 figure estimated before

1-1-1-1
2-2-2-2
x-x-3-3
x-x-4-4
--------
a-b-c-d



70-80-25-25
30-20-25-25
00-00-25-25
00-00-25-25
Ajax is offline  
November 26th, 2013, 07:24 AM   #10
Global Moderator
 
greg1313's Avatar
 
Joined: Oct 2008
From: London, Ontario, Canada - The Forest City

Posts: 7,963
Thanks: 1148

Math Focus: Elementary mathematics and beyond
Re: Help me with some basic maths!

If you choose 1 and 1 for the first and second numbers of the combination the probability of success is 0.7 * 0.8 * 0.25 * 0.25 = 0.035. Choosing 2 and 2 for the first and second numbers gives 0.3 * 0.2 * 0.25 * 0.25 = 0.00375. See?
greg1313 is offline  
Reply

  My Math Forum > College Math Forum > Advanced Statistics

Tags
basic, maths



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Maths Practice Problems Denis New Users 2 December 11th, 2012 05:51 AM
Financial Maths - Basic problem raidenciv Applied Math 4 September 21st, 2008 05:47 PM
Learning basic maths newby Algebra 2 August 30th, 2008 02:55 PM
Learning basic maths newby Abstract Algebra 1 December 31st, 1969 04:00 PM
Basic Maths Practice Problems coote Algebra 0 December 31st, 1969 04:00 PM





Copyright © 2019 My Math Forum. All rights reserved.