f



please can any one post the matlab script for these s• generate 100 random number or use the test data provided by the standard; • write Convolution Encoder using MATLAB script; Then you n

• generate 100 random number or use the test data provided by the standard;
• write Convolution Encoder using MATLAB script;
Then you need to verify the Convolution Encoder by
• calling MATLAB built in Convolution Encoder function ;
• calling MATLAB built in Viterbi Decoder function
0
vinay
12/8/2009 9:25:20 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

12 Replies
2043 Views

Similar Articles

[PageSpeed] 51

vinay vish wrote:
> • generate 100 random number or use the test data provided by the standard;
> • write Convolution Encoder using MATLAB script;
> Then you need to verify the Convolution Encoder by
> • calling MATLAB built in Convolution Encoder function ;
> • calling MATLAB built in Viterbi Decoder function

Yes, we -could-, but that is obviously a homework assignment. The purpose of a 
homework assignment is for you to learn how to do the work yourself, not for 
you to learn how to mooch off of other people.
0
roberson (2980)
1/19/2010 8:46:13 PM
Dear Walter!

> > • generate 100 random number or use the test data provided by the standard;

> Yes, we -could-, but that is obviously a homework assignment.

You *could* use the test data provided by the standard?!
I couldn't.

Does "generate 100 random number" allow forwarding this task to RAND as generator, or does this mean that the person has to generate them personally? I've read that humen choose 2, 7, 13 and 10 too seldom, because they are too odd or too even.

Kind regards, Jan
0
1/19/2010 10:32:04 PM
The command you need is "doc" and if that doesn't make sense try "why"
0
matlab2782 (44)
1/19/2010 10:46:02 PM
Jan Simon wrote:

> Does "generate 100 random number" allow forwarding this task to RAND as 
> generator, or does this mean that the person has to generate them 
> personally? I've read that humen choose 2, 7, 13 and 10 too seldom, 
> because they are too odd or too even.

We weren't told of any requirement for uniform random distribution ;-)

I still have all of my Dungeons & Dragons dice. Except that I never did figure 
out how to synthesize a fair D17 (17 sized die.)
0
roberson (2980)
1/19/2010 11:20:33 PM
Dear Walter!

> I still have all of my Dungeons & Dragons dice. Except that I never did figure 
> out how to synthesize a fair D17 (17 sized die.)

Use a gyroskop (spinning top) with the ring cut to a regular polygon with 17 sides. The side the gyroskop stops on is the wanted random number.

Here you can find a D34: http://wuerfel.faroul.de/
There must be a simple trick to omit the unneded bit.

Kind regards, Jan
0
1/20/2010 12:25:07 AM
Jan Simon wrote:

>> I still have all of my Dungeons & Dragons dice. Except that I never 
>> did figure out how to synthesize a fair D17 (17 sized die.)

> Use a gyroskop (spinning top) with the ring cut to a regular polygon 
> with 17 sides. The side the gyroskop stops on is the wanted random number.

Interesting... it turns out that there -is- a regular (compass and 
straight-edge) construction for the 17-gon and the 257-gon, so what you 
propose would be possible with a fair die -- though it might be a bit tricky 
to find a material that will hold 17 vertices without chipping.
http://en.wikipedia.org/wiki/Heptadecagon

The gyroscope part could be eliminated by taking two 17-sided (plus a base) 
pyramids and gluing them together at the base, and then using the same number 
on exactly two faces.
0
Walter
1/20/2010 8:22:48 PM
Walter Roberson <roberson@hushmail.com> wrote in message <4B563E41.7080509@hushmail.com>...
> Jan Simon wrote:
> 
> > Does "generate 100 random number" allow forwarding this task to RAND as 
> > generator, or does this mean that the person has to generate them 
> > personally? I've read that humen choose 2, 7, 13 and 10 too seldom, 
> > because they are too odd or too even.
> 
> We weren't told of any requirement for uniform random distribution ;-)
> 
> I still have all of my Dungeons & Dragons dice. Except that I never did figure 
> out how to synthesize a fair D17 (17 sized die.)

You can try to modify this one:
http://gamesbyemail.com/DiceGenerator

Jos
0
Jos
1/21/2010 7:34:04 AM
"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <hj5ih3$kv8$1@fred.mathworks.com>...
> Dear Walter!
> 
> > I still have all of my Dungeons & Dragons dice. Except that I never did figure 
> > out how to synthesize a fair D17 (17 sized die.)
> 
> Use a gyroskop (spinning top) with the ring cut to a regular polygon with 17 sides. The side the gyroskop stops on is the wanted random number.

Just being curious:

Is there a general algorithm to get random, uniformly distributed integers between 1 and N when all you have is an M-sided dice? 

Jos
0
Jos
1/21/2010 8:07:03 AM
On Jan 19, 5:46=A0pm, "Rob Campbell"
<mat...@robertREMOVEcampbell.removethis.co.uk> wrote:
> The command you need is "doc" and if that doesn't make sense try "why"

----------------------------------------------------------
As a fun aside, go to Google, and if you have the suggestions feature
turned on, type in "why."
It's very funny what prior questions show up as suggestions!
0
ImageAnalyst
1/21/2010 11:16:13 AM
"Jos (10584) " <#10584@fileexchange.com> wrote in message <hj91v7$5rg$1@fred.mathworks.com>...
> "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <hj5ih3$kv8$1@fred.mathworks.com>...
> > Dear Walter!
> > 
> > > I still have all of my Dungeons & Dragons dice. Except that I never did figure 
> > > out how to synthesize a fair D17 (17 sized die.)
> > 
> > Use a gyroskop (spinning top) with the ring cut to a regular polygon with 17 sides. The side the gyroskop stops on is the wanted random number.
> 
> Just being curious:
> 
> Is there a general algorithm to get random, uniformly distributed integers between 1 and N when all you have is an M-sided dice? 
> 
> Jos

Sure. Why not? Just change bases.

An M-sided die allows you to work in base M,
or if M is a composite number, to work with
more general radix numbers.

Now I wish to generate a random integer in
base N. Just generate enough "digits" in base
M, rejecting those that fall outside the desired
range when converted to base N digits.

However, I assume that your real question is
one where no rejection is necessary, therefore
no super sampling. I'll argue that a rejection
scheme can always be made quite efficient,
with a limited amount of resampling for large
enough sample sizes.

John
0
John
1/21/2010 11:55:21 AM
"John D'Errico" <woodchips@rochester.rr.com> wrote in message <hj9fb9$b16$1@fred.mathworks.com>...
> "Jos (10584) " <#10584@fileexchange.com> wrote in message <hj91v7$5rg$1@fred.mathworks.com>...
> > "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <hj5ih3$kv8$1@fred.mathworks.com>...
> > > Dear Walter!
> > > 
> > > > I still have all of my Dungeons & Dragons dice. Except that I never did figure 
> > > > out how to synthesize a fair D17 (17 sized die.)
> > > 
> > > Use a gyroskop (spinning top) with the ring cut to a regular polygon with 17 sides. The side the gyroskop stops on is the wanted random number.
> > 
> > Just being curious:
> > 
> > Is there a general algorithm to get random, uniformly distributed integers between 1 and N when all you have is an M-sided dice? 
> > 
> > Jos
> 
> Sure. Why not? Just change bases.
> 
> An M-sided die allows you to work in base M,
> or if M is a composite number, to work with
> more general radix numbers.
> 
> Now I wish to generate a random integer in
> base N. Just generate enough "digits" in base
> M, rejecting those that fall outside the desired
> range when converted to base N digits.
> 
> However, I assume that your real question is
> one where no rejection is necessary, therefore
> no super sampling. I'll argue that a rejection
> scheme can always be made quite efficient,
> with a limited amount of resampling for large
> enough sample sizes.
> 
> John

Thanks John for this answer. Your assumption is correct, however. 

I was thinking about some remapping of a few random numbers between 1 and N to the range 1 to M, without rejection or re-rolling the dice. And, yes, for some cases this is trivial (e.g., N=6, M =3). 

Jos
0
Jos
1/21/2010 2:47:04 PM
Jos (10584) wrote:

> Just being curious:

> Is there a general algorithm to get random, uniformly distributed 
> integers between 1 and N when all you have is an M-sided dice?

If M and N are relatively prime, then you cannot get exact fairness, but you 
can get fairness to any desired (finite) degree of accuracy. Start with 0 to 
N-1, and using rational fractions, subdivide the interval into M parts. Roll 
the die to select which subrange of the interval you get. If that subrange
contains only a single one of the original 1-N slots, then the selected number 
is that label. If the subrange spans multiple of the original 1-N slots, 
arithmetically subdivide the interval into M subintervals, roll the die,
select the appropriate sub-interval...

This process could, in theory, take forever, such as would be necessary
to resolve -exactly- 1/3 into binary (a 2 sided die). The -expected- number of 
rolls would probably not be too bad to calculate, though the formula doesn't 
immediately spring to mind. But because it could take forever, if you want a 
guaranteed time-limit of T steps, you could be inaccurate to N / (M^T)
(or perhaps T+1 instead of T, I'd have to work it through.) As fair as you 
have time for -- and no rejections.
0
Walter
1/21/2010 11:52:04 PM
Reply: